Languages
[Edit]
EN

Bash - own /custom command alias

2 points
Created by:
marc_so
1104

In this short article we will show how to create custom alias for some command in Bash in Linux.

Quick solution:

Pracitcal example:

Note: above solution will be providing alias only for current session - after login operaterion it will be necessary to create alias again.

Read next section to see how to add alias permanently.

Adding alias to user configuration example

Edit

In this section we show how to use .bashrc file to add permanently our alias to bash in our session.

1. Run following command (you can use different editor than nano):

2. Paste alias line into file (you can put it at the end of the .bashrc file):

3. Save file changes (ctrl+o) and close editor (ctrl+x).

4. Logout and login to check if my-ls alias is working:

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - own /custom command alias
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join