2015-11-05 18:12:40 +01:00
|
|
|
#C = custom (this whole files is custom)
|
|
|
|
|
|
|
|
# Some more ls aliases
|
2016-04-18 20:02:15 +02:00
|
|
|
alias ll='ls -lFh'
|
|
|
|
alias la='ls -AlFh'
|
2015-11-05 18:12:40 +01:00
|
|
|
alias l='ls -CF'
|
|
|
|
alias l.='ls -d .* --color=auto'
|
|
|
|
|
|
|
|
# Find all folders
|
2015-10-14 11:14:33 +02:00
|
|
|
alias lsf="ls -alF | grep /$"
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# This is GOLD for finding out what is taking so much space on your drives!
|
2015-10-14 11:14:33 +02:00
|
|
|
alias diskspace="du -Sh | sort -n -r |more"
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Command line mplayer movie watching for the win.
|
2015-10-14 11:14:33 +02:00
|
|
|
#alias mp="mplayer -fs"
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Show me the size (sorted) of only the folders in this directory
|
2015-10-14 11:14:33 +02:00
|
|
|
alias folders="find . -maxdepth 1 -type d -print | xargs du -sk | sort -rn"
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Easy move up directories
|
2015-10-14 11:14:33 +02:00
|
|
|
alias ..="cd .."
|
|
|
|
alias ...="cd ../.."
|
|
|
|
alias ....="cd ../../.."
|
|
|
|
alias .....="cd ../../../.."
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Make previous command sudo
|
2015-10-14 11:14:33 +02:00
|
|
|
alias s='sudo "$BASH" -c "$(history -p !!)"'
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Rm wil now prompt for deletion and show output
|
2015-10-14 11:14:33 +02:00
|
|
|
alias rm="rm -v"
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# easy archive extract
|
2015-10-14 11:14:33 +02:00
|
|
|
extract () {
|
|
|
|
if [ -f $1 ] ; then
|
|
|
|
case $1 in
|
|
|
|
*.tar.bz2) tar xvjf $1 ;;
|
|
|
|
*.tar.gz) tar xvzf $1 ;;
|
|
|
|
*.bz2) bunzip2 $1 ;;
|
|
|
|
*.rar) unrar x $1 ;;
|
|
|
|
*.gz) gunzip $1 ;;
|
|
|
|
*.tar) tar xvf $1 ;;
|
|
|
|
*.tbz2) tar xvjf $1 ;;
|
|
|
|
*.tgz) tar xvzf $1 ;;
|
|
|
|
*.zip) unzip $1 ;;
|
|
|
|
*.Z) uncompress $1 ;;
|
|
|
|
*.7z) 7z x $1 ;;
|
|
|
|
*) echo "don't know how to extract '$1'..." ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "'$1' is not a valid file!"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-11-05 18:12:40 +01:00
|
|
|
# Create dir and cd into it
|
|
|
|
function md () { mkdir -pv "$@" && cd "$@"; }
|
|
|
|
|
|
|
|
# easy apt-get
|
|
|
|
alias apt-get='sudo apt-get'
|
|
|
|
|
|
|
|
# Calculator
|
|
|
|
alias calc='bc -l'
|
|
|
|
|
|
|
|
# Show all open ports
|
|
|
|
alias ports='netstat -tulanp'
|
|
|
|
|
|
|
|
# Show memory usage
|
|
|
|
alias meminfo='free -m -l -t'
|
|
|
|
|
|
|
|
# Aliases for showing used harddisk space/files
|
|
|
|
alias df='df -H'
|
|
|
|
alias du='du -ch'
|
2016-06-15 15:23:58 +02:00
|
|
|
alias du1='du -ch -d 1 | sort -rh'
|
2016-01-27 23:28:25 +01:00
|
|
|
|
|
|
|
# Show all disks, partitions with sizes
|
|
|
|
alias lds='sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL'
|