Saturday, March 27, 2010

Keyboard shortcuts for shell

Some useful and more often used keyboard short cuts in bash shell under Mac

1)CTRL + A Move to the start of the line.

2)CTRL + E Move to the end of the line.( e for END)

3)CTRL + W Delete word backwards

4)CTRL + U Delete whole line backwards.(Delete from the cursor to the beginning of the line,If cursor is at the end of the line, it will delete the whole line) It can also be used to delete whole line if you are at the end of the command and you wish not to execute it.

5)CTRL + k Delete from the cursor to the end of the line.(Delete WHOLE LINE,if the cursor is in the starting,it will delete whole line)
Place the cursor in the right place and press Either U or K to delete rest of the line

6)CTRL + R to Search history. Press escape to verify and enter to execute

7)CTRL + L To clear line leaving the last line on the screen.

No comments: