Hands-on task
This task is step 7 of the course “First steps in Linux”
The start and end of a log
/root/logs/app.log is a web app's log, 120 lines long. You don't need to read all of it.
- Save the last 15 lines of the log to
/root/last.txt— the most recent events. - Save the first 5 lines to
/root/first.txt— how the day started.
Don't change the log itself.
What you'll practise:
- head
- tail
- tail -n
- redirection >