38/60
Sign inSign up free

743. A Table That Lines Up

easy 10 XP ~8 minHands-on lab

ps output is hard to paste into a ticket. Write /home/student/bin/report.sh FILE, where FILE is a CSV with a header and the columns name,cpu,mem_kb.

Task

Print a table to stdout, with columns separated by exactly one space:

ColumnWidthAlignmentContent
NAME16leftthe name, cut to 16 characters if longer
CPU%6rightcpu with one decimal
MEM(MB)9rightmem_kb / 1024 with one decimal

The first line is the header (NAME, CPU%, MEM(MB) aligned the same way), then one line per CSV row in file order. For example:

NAME               CPU%   MEM(MB)
nginx               2.5     120.0

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.