This should be fun. Share your alias collection. :)
Re: This should be fun. Share your alias collection. :)
Huh. If I ever knew about those apt-get aliases in MX-15 I have long since forgotten about them. Would have included them in the Manual...
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: This should be fun. Share your alias collection. :)
Well you asked for it:
This has reminded me that I have not reviewed these for ages, another item on the to-do list!
greywolf.
ps: you have to remember I am an old CLI/Keyboard junkie from way back. eg I still do not run graphical desktop on my servers!

Code: Select all
$ cat ~/.bash_aliases
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# install colordiff package :)
alias diff='colordiff'
alias mount='mount |column -t'
## Space on drive
alias disk='du -S | sort -n -r |more'
## pass options to free ##
alias meminfo='free -m -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
## older system use /proc/cpuinfo ##
##alias cpuinfo='less /proc/cpuinfo' ##
## get GPU ram on desktop / laptop##
alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
# some more ls aliases
alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size
alias lr='ls -lR' # recursice ls
alias lt='ls -ltr' # sort by date
alias lm='ls -al |more' # pipe through 'more'
alias tree='tree -Cs' # nice alternative to 'ls'
alias l='ls -hF --color' # quick listing
alias lsize='ls --sort=size -lhr' # list by size
alias lsd='ls -l | grep "^d"' #list only directories
#Command substitution
alias ff='sudo find / -name $1'
alias df='df -h -x tmpfs -x usbfs'
alias psg='ps -ef | grep $1'
alias h='history | grep $1'
#alias rm='rm -i'
#alias cp='cp -i'
#alias mv='mv -i'
alias mkdir='mkdir -p -v'
alias which='type -all'
alias path='echo -e ${PATH//:/\\n}'
alias vi='vim'
alias du='du -h -c --max-depth=1'
alias reload='source ~/.bashrc'
#alias dupgrd='sudo apt-get update && sudo apt-get dist-upgrade -d'
alias c='clear'
#Personal Help
#alias dn='OPTIONS=$(\ls -F | grep /$); select s in $OPTIONS; do cd $PWD/$s; break;done'
#alias help='OPTIONS=$(\ls ~/.tips -F);select s in $OPTIONS; do less ~/.tips/$s; break;done'
#show most popular commands
alias top-commands='history | awk "{print $2}" | awk "BEGIN {FS="|"} {print $1}" |sort|uniq -c | sort -rn | head -10'
# package stuff
alias acs="apt-cache search"
alias acp="apt-cache policy"
alias dep="apt-cache depends"
alias rdep="apt-cache rdepends"
# empty trash
alias trash="rm -fr ~/.Trash"
## Moving around & all that jazz
alias back='cd "$OLDPWD"'
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
## Dir shortcuts
alias home='cd ~/'
alias documents='cd ~/Documents'
alias downloads='cd ~/downloads'
alias images='cd ~/images'
alias videos='cd ~/videos'
alias music='cd ~/music'
## App-specific
alias wget='wget -c'
alias scrot='scrot -cd 5'
## Sudo fixes
alias install='sudo apt-get install'
alias remove='sudo apt-get remove'
alias orphand='sudo deborphan | xargs sudo apt-get -y remove --purge'
alias cleanup='sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get clean && sudo apt-get remove && orphand'
alias updatedb='sudo updatedb'
alias htop='sudo htop'
alias swapclear='sudo swapoff -a && sleep 2s && sudo swapon -a'
Code: Select all
cat ~/.bashrc
# Bash-configuration for user
# Check for an interactive session
[ -z "$PS1" ] && return
## Settings ##
# Colors
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
yellow='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
PURPLE='\[\e[1;35m\]'
purple='\[\e[0;35m\]'
nc='\[\e[0m\]'
if [ "$UID" = 0 ]; then
PS1="$red\u$nc@$red\H$nc:$CYAN\w$nc\\n$red#$nc "
else
PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc "
fi
# History file: http://tinyurl.com/lvtonry, http://tinyurl.com/q4dvgek
# HS: history command limit in active session (saved in mem. [def.: 500])
# HFS: history command limit in history file
# HC: erase previous matching duplicates
# hst: append entries instead of overwriting
# PC: add command to history after executing
HISTSIZE=5000
HISTFILESIZE=20000
HISTCONTROL=erasedups
shopt -s histappend
PROMPT_COMMAND='history -a'
# Bash completion extended (single press on partial or no-completion)
set show-all-if-ambiguous on
# Redirected output will not overwrite files
#set -o noclobber
# Allow 'less' to view non-text files (i.e. compressed files)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# 'ls' colors
eval $(dircolors -b)
# 'grep' colors
alias grep='grep --color=auto'
export GREP_COLOR="1;37" # white
# Less Colors for Man Pages
if [[ ${TERM} == "xterm" ]]; then
export LESS_TERMCAP_md=$'\e[01;38;5;74m' # bold mode - main (cyan)
export LESS_TERMCAP_us=$'\e[38;5;97m' # underline mode - second (purp)
export LESS_TERMCAP_so=$'\e[38;5;252m' # standout-mode - info/find (gray)
export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking - unused? (red)
export LESS_TERMCAP_ue=$'\e[0m' # end underline
export LESS_TERMCAP_se=$'\e[0m' # end standout-mode
export LESS_TERMCAP_me=$'\e[0m' # end all mode - txt rest
else
export LESS_TERMCAP_md=$'\e[01;34m'
export LESS_TERMCAP_us=$'\e[01;35m'
export LESS_TERMCAP_so=$'\e[01;30m'
export LESS_TERMCAP_mb=$'\e[01;31m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_me=$'\e[0m'
fi
## Aliases ##
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# mc & other apps need these env variables for external apps.
EDITOR=nano
export EDITOR
VISUAL=nano
export VISUAL
# News Server
NNTPSERVER='news.internode.on.net' && export NNTPSERVER
# Helps with sound problems in some games
export SDL_AUDIODRIVER="dsp"
# Set default file permission (see /etc/profile & ~/.kde/env)
umask 002
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
else
return 127
fi
}
fi
export GTK2_RC_FILES=$HOME/.gtkrc-2.0
greywolf.
ps: you have to remember I am an old CLI/Keyboard junkie from way back. eg I still do not run graphical desktop on my servers!
It is about the Dragons - it was always about the Dragons!
Re: This should be fun. Share your alias collection. :)
Wow .. really nice .. Greywolf. It must be easier to do the servers with all
those aliases / shortcut codes and etc. I've been trying to learn the commands,
file locations, system structure and generally how things work in Linux. I have
been an off and on (mostly off) for many years. Back in the mid 90's a friend
got me into redhat, but I switched to slackware later. If I would have kept at it,
instead of constantly distro hopping and running back to Windows, I would probably
be fairly knowledgeable now with Linux. Oh well.
Anyway, I'm going to see how much of your code / bashrc, that I make use of.
Thank You!
While I was typing the above, I got thinking about - Linux user numbers. I think
my friend and I registered as Linux users and got a graphic and a number. If I
still have it, it would probably be on some of my old floppies. That wasn't
yesterday.
those aliases / shortcut codes and etc. I've been trying to learn the commands,
file locations, system structure and generally how things work in Linux. I have
been an off and on (mostly off) for many years. Back in the mid 90's a friend
got me into redhat, but I switched to slackware later. If I would have kept at it,
instead of constantly distro hopping and running back to Windows, I would probably
be fairly knowledgeable now with Linux. Oh well.

Anyway, I'm going to see how much of your code / bashrc, that I make use of.

Thank You!
While I was typing the above, I got thinking about - Linux user numbers. I think
my friend and I registered as Linux users and got a graphic and a number. If I
still have it, it would probably be on some of my old floppies. That wasn't
yesterday.

MX-19.2_x64 | System76 Galago UltraPro / Clevo W740SU | Intel Core i7-4770HQ | Intel Iris Pro Graphics 5200 | 16 GB DDR3 | Intel 530 series mSATA SSD - 240-GB | WD7500BPKX - 750-GB | Intel HD Audio.
Re: This should be fun. Share your alias collection. :)
alias c2grep='grep -i -A 2 -B 2 --color=always $1 $2'
alias c3grep='grep -i -A 3 -B 3 --color=always $1 $2'
alias c4grep='grep -i -A 4 -B 4 --color=always $1 $2'
alias c5grep='grep -i -A 5 -B 5 --color=always $1 $2'
alias cct='cd ~/cct/'
alias cgrep='c3grep'
alias dl='cd ~/Downloads/'
alias lo='libreoffice $1 &'
alias ls='ls --color=never '
alias lsd='ls -Fd $1 | grep /$'
alias lsf='ls -Fdltr '
alias lsl='ls -Fdltr '
alias math='cd ~/maths/'
alias nen='ne --no-syntax '
alias pcb='cd ~/ee/pcb'
alias shodate='date --date=today '\''+%a %b %e, %Y'\'''
alias shodt='date --date=today '\''+%A %b %e, %Y %I:%M %p'\'''
alias shosd='ls -Fd * | grep /$'
alias ssd='shosd'
alias c3grep='grep -i -A 3 -B 3 --color=always $1 $2'
alias c4grep='grep -i -A 4 -B 4 --color=always $1 $2'
alias c5grep='grep -i -A 5 -B 5 --color=always $1 $2'
alias cct='cd ~/cct/'
alias cgrep='c3grep'
alias dl='cd ~/Downloads/'
alias lo='libreoffice $1 &'
alias ls='ls --color=never '
alias lsd='ls -Fd $1 | grep /$'
alias lsf='ls -Fdltr '
alias lsl='ls -Fdltr '
alias math='cd ~/maths/'
alias nen='ne --no-syntax '
alias pcb='cd ~/ee/pcb'
alias shodate='date --date=today '\''+%a %b %e, %Y'\'''
alias shodt='date --date=today '\''+%A %b %e, %Y %I:%M %p'\'''
alias shosd='ls -Fd * | grep /$'
alias ssd='shosd'
Re: This should be fun. Share your alias collection. :)
The only aliases I add are the ssh commands I use to connect to my various servers, both local & remote. They are all similar to this one:
alias music='ssh -Y musicbox@192.168.1.111'
alias music='ssh -Y musicbox@192.168.1.111'
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Re: This should be fun. Share your alias collection. :)
on page one there are some apt-get commands.
For those like me who are used to apt-get commands, recently I discovered you can drop it and just use apt like this.
There are still commands like apt-cache and apt-get that I have been unable to convert to apt only like $ apt-cache showpkg Thunar
Hope that helps
For those like me who are used to apt-get commands, recently I discovered you can drop it and just use apt like this.
Code: Select all
sudo apt search <search-term>
sudo apt update
sudo apt upgrade
sudo apt install <new-package>
Hope that helps
Re: This should be fun. Share your alias collection. :)
Code: Select all
sudo apt update
sudo apt upgrade
Code: Select all
# apt update
bash: apt: command not found
# apt upgrade
bash: apt: command not found
Re: This should be fun. Share your alias collection. :)
@ mods
can you split eemaestro reply and this post to a new thread as it we may be going off topic?
otherwise I can see eemaestro has already got root by the #
can he/she show the result of
I show mine
apt: /usr/bin/apt /usr/lib/apt /etc/apt /usr/share/man/man8/apt.8.gz
Its possible to remove the apt package but the poster would needed to enter the special string
To continue type in the phrase 'Yes, do as I say!'
can you split eemaestro reply and this post to a new thread as it we may be going off topic?
otherwise I can see eemaestro has already got root by the #
can he/she show the result of
Code: Select all
whereis apt
apt: /usr/bin/apt /usr/lib/apt /etc/apt /usr/share/man/man8/apt.8.gz
Its possible to remove the apt package but the poster would needed to enter the special string
To continue type in the phrase 'Yes, do as I say!'
Last edited by aus9 on Wed Jul 13, 2016 8:45 pm, edited 1 time in total.
Re: This should be fun. Share your alias collection. :)
Code: Select all
# whereis apt
apt: /etc/apt /usr/lib/apt /usr/share/man/man8/apt.8.gz
# which apt
#
Re: This should be fun. Share your alias collection. :)
hmm you are missing the executable.
Can you run synaptic and see if you can reload apt?
But you may be missing more apt packages?
what do you get when you run this command?
I show mine but some are not apt terminal stuff but GUI and scrot etc
ii apt 1.0.9.8.3 amd64 commandline package manager
ii apt-mx 0.1.3 all apt defaults for MX-15.
ii apt-notifier 1.3.3mx150+1 all tray applet to notify of system and application updates
ii apt-transport-https 1.0.9.8.3 amd64 https download transport for APT
ii apt-utils 1.0.9.8.3 amd64 package management related utility programs
ii aptitude 0.6.11-1+b1 amd64 terminal-based package manager
ii aptitude-common 0.6.11-1 all architecture independent files for the aptitude package manager
ii checkaptgpg 0.3.1mx150+4 all check and add missing GPG keys needed by apt
ii freshplayerplugin 0.3.3-0mx150+1 amd64 PPAPI-host NPAPI-plugin adapter
ii libapt-inst1.5:amd64 1.0.9.8.3 amd64 deb package format runtime library
ii libapt-pkg4.12:amd64 1.0.9.8.3 amd64 package management runtime library
ii libopencore-amrnb0:amd64 0.1.3-2.1 amd64 Adaptive Multi Rate speech codec - shared library
ii libopencore-amrwb0:amd64 0.1.3-2.1 amd64 Adaptive Multi-Rate - Wideband speech codec - shared library
ii libpcap0.8:amd64 1.6.2-2 amd64 system interface for user-level packet capture
ii libraptor2-0:amd64 2.0.14-1 amd64 Raptor 2 RDF syntax library
ii python-apt-common 0.9.3.12 all Python interface to libapt-pkg (locales)
ii python3-apt 0.9.3.12 amd64 Python 3 interface to libapt-pkg
ii scrot 0.8-13 amd64 command line screen capture utility
ii synaptic 0.81.2 amd64 Graphical package manager
I just chmodded my /usr/bin/apt to 000 and was still able to use synaptic to install a new package so with luck you can install any missing packages and re-install apt
I had a peek at some of your other posts and so do not try to use the chmod command on apt....it was just me trying to see if a broken apt would still work for synaptic users.
EDIT 2
OK just tested using synaptic with out the executable /usrb/bin/apt and by checking the box for apt
marking it for re-installation
clicking tick button it re-installs and I regain the missing executable.
Hope that helps
Can you run synaptic and see if you can reload apt?
But you may be missing more apt packages?
what do you get when you run this command?
Code: Select all
dpkg -l | grep apt
ii apt 1.0.9.8.3 amd64 commandline package manager
ii apt-mx 0.1.3 all apt defaults for MX-15.
ii apt-notifier 1.3.3mx150+1 all tray applet to notify of system and application updates
ii apt-transport-https 1.0.9.8.3 amd64 https download transport for APT
ii apt-utils 1.0.9.8.3 amd64 package management related utility programs
ii aptitude 0.6.11-1+b1 amd64 terminal-based package manager
ii aptitude-common 0.6.11-1 all architecture independent files for the aptitude package manager
ii checkaptgpg 0.3.1mx150+4 all check and add missing GPG keys needed by apt
ii freshplayerplugin 0.3.3-0mx150+1 amd64 PPAPI-host NPAPI-plugin adapter
ii libapt-inst1.5:amd64 1.0.9.8.3 amd64 deb package format runtime library
ii libapt-pkg4.12:amd64 1.0.9.8.3 amd64 package management runtime library
ii libopencore-amrnb0:amd64 0.1.3-2.1 amd64 Adaptive Multi Rate speech codec - shared library
ii libopencore-amrwb0:amd64 0.1.3-2.1 amd64 Adaptive Multi-Rate - Wideband speech codec - shared library
ii libpcap0.8:amd64 1.6.2-2 amd64 system interface for user-level packet capture
ii libraptor2-0:amd64 2.0.14-1 amd64 Raptor 2 RDF syntax library
ii python-apt-common 0.9.3.12 all Python interface to libapt-pkg (locales)
ii python3-apt 0.9.3.12 amd64 Python 3 interface to libapt-pkg
ii scrot 0.8-13 amd64 command line screen capture utility
ii synaptic 0.81.2 amd64 Graphical package manager
I just chmodded my /usr/bin/apt to 000 and was still able to use synaptic to install a new package so with luck you can install any missing packages and re-install apt
I had a peek at some of your other posts and so do not try to use the chmod command on apt....it was just me trying to see if a broken apt would still work for synaptic users.
EDIT 2
OK just tested using synaptic with out the executable /usrb/bin/apt and by checking the box for apt
marking it for re-installation
clicking tick button it re-installs and I regain the missing executable.
Hope that helps