Memorize these commands and their basic usage. These will help you navigate, and view and manage files.
pwd
- print current working directorycd
- change directorymkdir
- make directoryls
- listcp
- copymv
- move (a.k.a. rename)rm
- removeless
- page back and forth through a file without opening up a text editorcat
- concatenates files and prints themman
- view the man pages for a commandwhich
- locates a command on your pathtouch
- change the timestamp of a file (or creates it if it doesn’t already exist)grep
- find a string within directory/filesecho
- print something outhistory
- prints out your command historyexit
- exits the terminal
- up arrow - recall a previous command
!123
- recall command number 123- tab key - auto-complete a command or file name; hit tab twice to show options
clear
- command to clear the screenCTRL-a
- go to the beginning of the lineCTRL-e
- go to the end of the lineCTRL-_
- undo last changeCTRL-u
- put everything back to the beginning of the line in your shell's copy bufferCTRL-y
- bring back everything from the shell's copy buffer and add it your commandsCTRL-k
- kill/delete to the end of the lineq
- quit commands like less or man to return to the command lineCTRL-c
- stop running commands
Let’s play around with these commands and keystrokes and see what they output. Remember to use man
to figure out the format of the command.
Try this now:
BabyMac:~ jennapederson$
Back: Basics of the Bash Shell Forward: How to Not Hate Vim