What does the head command do?
Displays the beginning of a file.
Why is head useful?
Quick checks on header or initial configurations.
Default behavior of head?
Shows the first 10 lines.
Syntax of head?
head [options] file
Example: View first 50 lines?
head -n 50 /etc/apache2/httpd.conf
What does tail do?
Shows the end of a file.
Why is tail useful?
Real-time monitoring of log files.
Default behavior of tail?
Displays last 10 lines.
Syntax of tail?
tail [options] file
Example: monitor logs in real time?
tail -n 20 -f /var/log/syslog
What does -n mean in tail?
Specifies number of lines.
What does -f mean in tail?
Follows file as it grows.
What does more do?
Views long files one page at a time.
What type of tool is more?
A pager.
Syntax of more?
more [options] file
Example using more with pipe?
cat /var/log/syslog | more
How to scroll in more?
Spacebar for pages, Enter for lines.
What does less do?
Enhanced pager with backward scrolling and searching.
Why is less better than more?
Supports backward navigation and search.
Syntax of less?
less [options] file
Example of interactive viewing?
cat /etc/passwd | less