Monday morning. The weekly summary from the evening on-call shift is waiting in ~/reports, and you need to add your figures to it.
Start by opening it. The exercise sets up the directory with the summary and moves you into it.
Open the weekly summary
In ~/reports, run the three commands in order and note what each one prints.
Why is cat summary.txt refused while sudo cat summary.txt prints the summary?
-
A damaged file would not read through sudo either: root's rights do not repair content.
sudo catprints the whole summary, so the file is intact and what differs is who reads it. -
Linux does not lock a file while another program holds it open: several programs can read one file at once. "Permission denied" comes from the permission check.
-
The directory opens without sudo:
ls ~/reportslists its contents. The refusal comes from the summary file itself.
The summary belongs to root and only its owner may read it, while cat runs as student and sudo cat runs as root.