Question 3.32: You want to create aliases to commands that you use frequent......

You want to create aliases to commands that you use frequently.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

Edit the file ~/.bashrc using nano (Recipe 3.6), and then move to the end of the file and add as many lines as you want, like this:

alias l=’ls -a’

This creates an alias called l that, when entered, will be interpreted as the command ls -a.

Save and exit the file using Ctrl-X and Y, and then to update the Terminal with the new alias, type the following command:

$ source .bashrc

Discussion

Many Linux users set up an alias for rm like the following, so that it confirms deletions.

$ alias rm=’rm -i’

This is not a bad idea, as long as you do not forget when you use someone else’s system that doesn’t have this alias set up!

See Also

For more information about rm, see Recipe 3.10.

Related Answered Questions

Question: 3.34

Verified Answer:

Use the Linux df command: $ df -h Filesystem   ...
Question: 3.33

Verified Answer:

Use the Linux date command. The date and time form...
Question: 3.31

Verified Answer:

Run the program or command in the background using...
Question: 3.30

Verified Answer:

Redirect the output to /dev/null using >. For e...
Question: 3.24

Verified Answer:

Use the Task Manager utility, which you’ll find on...
Question: 3.29

Verified Answer:

Use the pipe command, which is the bar symbol (|) ...
Question: 3.27

Verified Answer:

Use the > command to redirect output that would...
Question: 3.28

Verified Answer:

Use the cat command to concatenate a number of fil...
Question: 3.26

Verified Answer:

Use the lsusb command. This will list all the devi...
Question: 3.25

Verified Answer:

Depending on the file type, you will need to use t...