30 Handy Bash Shell Aliases For Linux / Unix
Introduction
Bash shell aliases are shortcuts that you can create to make your work in the Linux command line faster and more efficient. With an alias, you can reduce the amount of typing you need to do by defining a shorter and more memorable command to execute a complex or repetitive task.
In this blog, we'll go over 30 handy Bash shell aliases for Linux that can help you become more productive on the command line.
- ls - List directory contents
Alias: alias ll='ls -alF'
Description: The alias ll is a convenient way to list the contents of a directory, showing detailed information about each file including permissions, ownership, and file type.
- cd - Change directory
Alias: alias ..='cd ..'
Description: The alias .. is a quick way to move up one level in the directory hierarchy.
- grep - Search for patterns in files
Alias: alias grep='grep --color=auto'
Description: The alias grep enables the color output of grep, making it easier to read search results.
- cp - Copy files or directories
Alias: alias cp='cp -i'
Description: The alias cp makes the cp command interactive, prompting you to confirm before overwriting existing files.
- mv - Move or rename files or directories
Alias: alias mv='mv -i'
Description: The alias mv makes the mv command interactive, prompting you to confirm before overwriting existing files.
- rm - Remove files or directories
Alias: alias rm='rm -i'
Description: The alias rm makes the rm command interactive, prompting you to confirm before deleting files.
- df - Display free disk space
Alias: alias df='df -h'
Description: The alias df displays the free disk space in human-readable format.
- du - Display disk usage
Alias: alias du='du -h'
Description: The alias du displays the disk usage in human-readable format.
- tail - Display the last lines of a file
Alias: alias tailf='tail -f'
Description: The alias tailf displays the last lines of a file and keeps the output updated as new lines are added.
- top - Display system processes
Alias: alias top='htop'
Description: The alias top displays the system processes using htop, which provides a more interactive and detailed view.
- history - Display command history
Alias: alias history='history | cut -c 8-'
Description: The alias history displays the command history without line numbers.
- tar - Create or extract archives
Alias: alias tar='tar -v'
Description: The alias tar displays verbose output when creating or extracting archives.
- unzip - Extract compressed files
Alias: alias unzip='unzip -q'
Description: The alias unzip extracts files without displaying unnecessary information.
- ssh - Connect to a remote server
Alias: alias ssh='ssh -v'
Description: The alias ssh displays verbose output when connecting to a remote server.
- ping - Test network connectivity
Alias: alias ping='ping -c 5'
Description: The alias ping sends five packets when testing network connectivity.
- date - Display the current date and time
Alias: alias now='date +"%T"'
Description: The alias now displays the current time in 24-hour format.
- cat - Display the contents of a file
Alias: alias cat='bat'
Description: The alias cat displays the contents of a file using the bat command, which provides syntax highlighting and line numbers.
- vi - Open a file in vi editor
Alias: alias vi='vim'
Description: The alias vi opens files in the vim editor, which is more feature-rich than the default vi editor.
- which - Display the location of an