alias command Updated on March 31, 2022 by Scott Mitchell 1 Minutes, 23 Seconds to Read When working with SSH and the command line interface, you may want to begin trimming down the number of keys you hit by creating aliases for the commands you use most often. This can help you move along faster when working on your site. This article goes over the alias command and how to use it. Command: alias Synopsis: alias [name[=value] …] Examples Alias for the clear command In this example, we create an alias for the ‘clear‘ command. We shorten it to simply ‘c‘. # alias c='clear' Aliases for various cd commands For this example, we will make some shorter cd commands for going up one, two, or three levels. # alias ..='cd ..' # alias ...='cd ../..' # alias ....='cd ../../..' Aliases for common mistakes If you have a habit of not leaving a space in between the ‘cd” and the ‘..’ portion of the ‘cd ..‘ command, you can create an alias for that as well. # alias cd..='cd ..' Listing the aliases If you want to have the entire list of aliases displayed, use the following version of the alias command. # alias -p alias attrib='chmod' alias chdir='cd' alias copy='cp' alias cp='cp -i' alias d='dir' alias del='rm' alias deltree='rm -r' Removing an alias The following couple of examples demonstrate how to remove aliases with the ‘unalias‘ command. Removing a single alias This example shows how to remove a single alias. In the example below we are removing the ‘c‘ alias we created above.’ # unalias c Remove all aliases If you wish to clear your alias list, use the following command. Do note that it deletes ALL aliases. # unalias -a Share this Article Related Articles Understanding Linux Operating Systems How to Install Python 3.9 on CentOS 7 Speed Up grep Searches with LC_ALL=C How To Install RubyGems On Linux unrar and rar Commands 5 Ways to Find a File in Linux Setting Your PHP Settings in Command Line How to Check the Memory Usage on Linux How to Send Files to the Trash Can in Linux with Gio Trash How to Merge PDF Files in the Linux Terminal