Keyboard Commands
There are several keyboard tricks that are good to know when using the Terminal Activity. These save time and work regardless of the commands you are using.
CTRL L
If you been doing a lot in your terminal and the terminal window is full of text you can press CTRL on the keyboard and 'l' (lower case 'L') simultaneously and the termianl window will be cleared of text leaving you with a nice clear terminal.
CTRL C
If for any reason you are finding that a command you are using seems to be stuck or is taking too long you can use CTRL and 'c' (pressed simultaneously) and this will halt the command. This means your command will be stopped before finishing so make sure you really want to do this before trying it.
TAB Complete
If you want to save some time typing out long commands you can always use the TAB key. This is called 'Tab completion'. If you have partly typed a command try pressing the Tab key. If there are no other commands that start with the same sequence of letters then the complete command will be automatically displayed in the terminal. Try for example typing half of the 'help' command like this :
hel
followed by pressing Tab. You will see the terminal will display 'help'. This is because the terminal 'knows' that there are no other commands starting with 'hel' so it assists you by completing the full command name when you press Tab.
If there is more than one command that starts with the letters you have typed then pressing Tab once will do nothing. Try, for example, typing :
he
followed by the Tab key. Nothing happens. Now try the same thing but press Tab and quickly follow it by pressing Tab again. In this case you will see all the other commands displayed that start with 'he' like so :
You can now see the other commands starting with these same letters and you can either choose one by typing out the wole command, or you can type some more letters of the command you want and finish it with Tab complete.