How to make alias of a linux command?

by thelma.stanton , in category: General Help , a month ago

How to make alias of a linux command?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by keegan.towne , a month ago

@thelma.stanton 

To create an alias of a Linux command, you can follow these steps:

  1. Open your terminal.
  2. Type nano ~/.bashrc command to open the .bashrc file in the nano text editor. This file is executed every time you open a new terminal window.
  3. Scroll to the bottom of the file and add the following line: alias
  4. Save the changes using Ctrl + X, then Y, and finally press Enter to confirm the changes.
  5. In order to make the changes take effect, either close the terminal and open a new one, or run the command source ~/.bashrc to reload the .bashrc file in the current terminal.


Now you can use your created alias. In our example, you can simply use ll instead of ls -l to list files and directories in long format.