Here are five bash aliases that I find useful.
alias 'dus=du -sckx * | sort -nr'
Here is a breakdown of the command.
du – command estimates file system usage-s – creates a total for each argument-c – creates a grand total-k – sets the block size to kilobytes. Using -m would set it to megabytes-x – skips directories on other file systemsThe output of the du -sckx * command is then piped to sort -nr.
sort – sorts lines-n – does a numerical sort-r – reverses the result, so it is in descending orderalias inet='ifconfig | grep inet | grep -v inet6'
Here is a breakdown of the command.
ifconfig – lists the current network interface configuration| grep inet – returns only the lines with inet| grep -v inet6 – eliminate those lines with inet6, i.e., IPv6Depending on your OS you may need to use ip a instead of ifconfig.
alias latr='ls -latr'
Here is a breakdown of the command.
ls – lists directory contents-l – use the long format-a – do not ignore hidden files-t – sort by modification time, newest first-r – reverse the sort orderThe mnemonic I use for this alias is “later”.
alias 'define=curl dict://dict.org/define:"$@"'
Here is a breakdown of the comment.
curl – transfers a URL, in this case dict://dict/org/define"$@" – the search term providedalias makepass='openssl rand -base64 15'
Here is a breakdown of the command.
openssl – runs the openssl command line toolrand – generates pseudo-random bytes-base64 – use base6415 – make the resulting password 15 characters long