Commands Flashcards
Used to drill down to specific content
”|” - pipe
Ex: cat secure | grep fail
- this will search for any lines that have “fail” in them
Used to display last few lines of a file
tail “file” - this will display the last 10 lines by default. Ex: tail cron; tail secure
To change the number of lines displayed, add “-n” flag. Ex: tail -n 20 secure - will display last 20 lines of the file “secure”
Use -f flag to get realtime updates to the file displayed. Ex: tail -f secure
Show the current directory you are working in
pwd
Changing directories
cd “directory name”
Automatically completes the command being typed
Hit the Tab key
Use Tab Tab to complete a chosen command if more than one option is available
Go up one directory level
cd ..
Go back to home directory of current user
cd ~
Go to specific folder
cd “folder name”
List contents of a current directory
ls
ls / will list root directory
ls -a will list complete content if a directory, including hidden files
Move to beginning of the line
Move to the end of the line
“Ctrl” “a”
“Ctrl” “e”