Linux Labs

First steps / Stage 11 of 15

Where a command's output goes

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 6 · on a machine · 5 min

A report on log size

The same technique with a different command: the old report lines stay, and the error messages go to a file of their own.

Once a week the size of /var/log is added to the report, to see how fast the logs grow. du with the -sh options prints how much space a directory takes, such as 17M /var/log. Directories that student may not look into, du skips, reporting each one to the error stream. This time, put the commands together yourself.

Exercise · do it

Add to the report without losing lines

~/stream-lab/report.log has two lines — the size of /var/log in past weeks. Add a third with today's size, which du -sh /var/log prints. The old lines must stay, and du's error messages must end up in errors.log.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Add today's size, keeping the old lines not done yet
  • Collect du's error messages in errors.log not done yet

Step goals

0 of 2
  • Add today's size, keeping the old lines — not done yet
  • Collect du's error messages in errors.log — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Add today's size, keeping the old lines — not done yet
  • Collect du's error messages in errors.log — not done yet
Loading…