If you are a lazy admin you can use the following tricks:
- You want to use the last argument of the previous command. Example:
mkdir This is a new folder with great pictures cd This is a new folder with great pictures
Instead of typing the whole thing again you can simple use !$
mkdir This is a new folder with great pictures cd !$
- Another way to use previous use arguments is ALT+.
This cycles through previous arguments.
- If you are typing a long command with many arguments, you can delete the last one wiht CTRL+ W
- You can go back to the previos directory the – argument. Example:
[user@pc:/etc]$ cd /usr/src/linux [user@pc:/usr/src/linux]$ cd - /etc [user@pc:/etc]$
- If you decide you don’t want to run the command you just typed, you can hit ALT+# to keep it in history. Example:
rm -rf /
#rm -rf /