Who doesn't like shortcuts? Well, the answer is my wife. But only because my shortcuts usually double the length of our trips... Anyway, if you are going to spend any time in the Linux command line interface, I highly recommend learning a few easy shortcuts that will make your life MUCH easier!
Auto Complete Anything You Type!
One of the best shortcuts is the auto-complete feature in Linux. Just start typing the name of a file, directory or program and then hit <TAB>.
ls m <TAB><TAB><TAB>
Then push the <TAB> key. Linux is going to beep a couple of times, but you keep pushing. You will now see every file in the directory that begins with the letter 'm'
Now add an 'o' on to `ls m` so you get `ls mo` - now push the tab key.
ls mo <TAB>
You should see 'motd'. This is a file that contains your startup message. SuSE has a famous one that says 'Have a lot of fun!'. I like that one so I haven't changed it, but you can change it so that Linux says anything you want when you log in.
Linux Saves Everything That You Type In Your History File!
Do you want to make sure that lilo.conf is still in there? You don't have to type 'lilo.conf' or even part of it and press the tab key anymore. You just have to press the up arrow. Your last commands will appear when you do that.
Your commands are saved in a history file located in your home directory. The more times you press the up button, the farther back in time you go. Pressing the down button gets you back to your most recent commands. Just stop on the command you want and press 'enter'. You can even type the command history and all of the last 400 or so commands you've typed will be presented. As you get more proficient in Linux, you'll find that thisreally comes in handy. You can often find out the answer to the question: How did I do that? by consulting your shell history.
The /usr directory
Let's talk about using some options with commands.
this will take you to the /usr directory
This will give you a more detailed view about the contents of your current directory, which happens to be the /usr directory.
You will see more information, like dates, some numbers, letter combinations. It will say 'root' a lot. We'll get into more detail about what all of that means later in the course. You'll see mainly sub-directories here. The usr/ directory contains files and programs meant to be used by all of the users on the system.
Auto Complete Anything You Type!
One of the best shortcuts is the auto-complete feature in Linux. Just start typing the name of a file, directory or program and then hit <TAB>.
ls m <TAB><TAB><TAB>
Then push the <TAB> key. Linux is going to beep a couple of times, but you keep pushing. You will now see every file in the directory that begins with the letter 'm'
Now add an 'o' on to `ls m` so you get `ls mo` - now push the tab key.
ls mo <TAB>
You should see 'motd'. This is a file that contains your startup message. SuSE has a famous one that says 'Have a lot of fun!'. I like that one so I haven't changed it, but you can change it so that Linux says anything you want when you log in.
Linux Saves Everything That You Type In Your History File!
Do you want to make sure that lilo.conf is still in there? You don't have to type 'lilo.conf' or even part of it and press the tab key anymore. You just have to press the up arrow. Your last commands will appear when you do that.
Your commands are saved in a history file located in your home directory. The more times you press the up button, the farther back in time you go. Pressing the down button gets you back to your most recent commands. Just stop on the command you want and press 'enter'. You can even type the command history and all of the last 400 or so commands you've typed will be presented. As you get more proficient in Linux, you'll find that thisreally comes in handy. You can often find out the answer to the question: How did I do that? by consulting your shell history.
The /usr directory
Let's talk about using some options with commands.
Code:
cd /usr
Code:
ls -l
You will see more information, like dates, some numbers, letter combinations. It will say 'root' a lot. We'll get into more detail about what all of that means later in the course. You'll see mainly sub-directories here. The usr/ directory contains files and programs meant to be used by all of the users on the system.