Posted by CameronW, on December 30th, 2018 - 660 days ago - 265 words -

Helpful Bash Aliases

# Restart Common Services
alias restartapache2='sudo /etc/init.d/apache2 restart'
alias webstatus='sudo /etc/init.d/apache2 restart'
alias restartsamba="sudo /etc/init.d/smbd restart"
# Replace the 192.168.X.XXX with the IP of the computer/sever.
alias phpserver="php -S 192.168.X.XXX:8080"
alias sha1='openssl sha1'
alias mkdir='mkdir -pv'
alias erase='shred -zvu'
# update on one command
alias update='sudo apt-get update && sudo apt-get upgrade'
## 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'
## this one saved by butt so many times ##
alias wget='wget -c'
#Grabs the disk usage in the current directory
alias usage='du -ch | grep total'
#Gets the total disk usage on your machine
alias totalusage='df -hl --total | grep total'
#Shows the individual partition usages without the temporary memory values
alias partusage='df -hlT --exclude-type=tmpfs --exclude-type=devtmpfs'
#Gives you what is using the most space. Both directories and files. Varies on
#current directory
alias most='du -hsx * | sort -rh | head -10'