Search/Navigation
Multiple directories
Lists directories with size : du . -h
Search refining: Lists files which are:
writable
executable
not readable
owned by user 'bandit7'
owned by group 'bandit6'
of size 33mb
Output line count | -n: number, -r : reverse
Print all matching lines (without the filename or the file path) in all files under the current directory that start with "access.log" that contain the string "500"
Find no: of lines in access.log with the word "GET" | -r :recursive | -i :Ignore test cases
Prints 1-100 : echo {1..100}
Delete all files in directory : find . -delete
List directories recursively without directory name
Sort | List unique entries | Grep out | -r:recursive; -l:match
Print the difference: diff passwords.new passwords.old
Remove line wrapping | Cleaner output: ./any | less -S
cut command
Can only accept a single character as a field delimiter
-f for the field number; -d for the field delimiter
uniq -c : Prefix output with no: of occurences
awk command
-F : Field separator; print :Outputs the result text.
tail command
-f (follow) continuously updates the output as the target file grows.
-n X, outputs the last “X” number of lines, instead of the default value of 10.
watch command
run a designated command at regular intervals. Default: runs every two seconds
-n X option to have it run every “X” number of seconds.
-w - list logged-in users
Last updated