-n = number of lines to show
-f = follow
-q = quite (don't show file headers)
- Foreground logs so you can see logs but still access shell
tail -f /var/log/something.log &
- Combine multiple log files
tail -q -f /var/log/auth.log -f /var/log/messages
-H = Print the file name of each match
-n = line number
-r = recursive
-i = ignore case
- Look for usage of a string in a directory
grep -Hnir '<string>' .
- Look before and after string
grep -Hnir -A 5 -B 5 'otter' .
- How many functions in a python codebase
grep -Hir 'def ' . | cut -d':' -f1 | uniq -c | sort -nr