Five Useful Bash Aliases




Here are five bash aliases that I find useful.

List contents of current directory, sorted by size

alias 'dus=du -sckx * | sort -nr'

Here is a breakdown of the command.

The output of the du -sckx * command is then piped to sort -nr.

Show all currently assigned IPv4 IP addresses

alias inet='ifconfig | grep inet | grep -v inet6'

Here is a breakdown of the command.

Depending on your OS you may need to use ip a instead of ifconfig.

List directory contents sorted by modification time

alias latr='ls -latr'

Here is a breakdown of the command.

The mnemonic I use for this alias is “later”.

Look up a word’s definition

alias 'define=curl dict://dict.org/define:"$@"'

Here is a breakdown of the comment.

Make a password

alias makepass='openssl rand -base64 15'

Here is a breakdown of the command.