2. tail Command
Definition
tail displays the last few lines of a file.Syntax
Loading...Example
Loading...Output (last 10 lines)
Loading...Show last 5 lines
Loading...Output
Loading...Watch a file as it grows (very useful)
Loading...fmeans follow.
If new lines are added to
server.log, they appear automatically.Example:
Terminal:
Loading...Another process writes:
Loading...You immediately see
Loading...This is commonly used for:
- Watching server logs
- Debugging applications
- Monitoring system logs
Press Ctrl + C to stop.
.jpg?table=block&id=29d76b1d-f1a8-8072-a9bf-cc78d1c7d881&cache=v2)
