Monday, April 13, 2015

Day 10: The Linux Command Line Ch8 Notes


Chapter 8 - Advanced Keyboard Tricks

Commands:
clear – Clear the screen
history – Display the contents of the history list


Lab 4 
Type the following on the terminal screen (include the # tag):
# Live long prosper and.

Using keyboard shortcuts do the following:

1. Move the cursor to the beginning of the line.
2. Move the cursor the end of the line.
3. Move the cursor one word back
4. Transpose the word at the cursor location with the one preceding it.
5. Move the cursor to the beginning of the line.
6.  Convert 'Live' to lower case 'live'.
7. Convert 'live' to upper case "LIVE".
8. Using arrow key move the cursor to position after the word 'long' and before the word 'and. Then remove the words to the end of the line.
9. Remove the text to the beginning of the line.
10. Display all possible completion of D.
11. Clear the screen using two methods.
12. Display the history of the commands.
13. Repeat the last command.



Lab 4 Solution

Type the following on the terminal screen (include the # tag):
# Live long prosper and.

Using keyboard shortcuts do the following:

1. Move the cursor to the beginning of the line.

CTRL-a

2. Move the cursor the end of the line.

CTRL-e

3. Move the cursor one word back

ALT-b

4. Transpose the word at the cursor location with the one preceding it.

ALT-t

5. Move the cursor to the beginning of the line.

CTRL-a

6.  Convert 'Live' to lower case 'live'.

ALT-l

7. Convert 'live' to upper case "LIVE".

ALT-a
ALT-u

8. Using arrow key move the cursor to position after the word 'long' and before the word 'and. Then remove the words to the end of the line.

CTRL-k

9. Remove the text to the beginning of the line.

CTRL-u

10. Display all possible completion of D.

D followed by ALT-? (shift-alt-?).
or
D followed by ALT-* (shift-alt-*).

11. Clear the screen using two methods.

$ clear

or

$ CTRL-l

12. Display the history of the commands.

$ history

13. Repeat the last command.

$ !!