Demo mode This site is not live. It is currently being tested and developed. Nothing on here represents an offer.
← Exit course IT-202 Linux Command Line and System Administration
Course progress, 0 of 14 parts done0%
Practical work

4 hands-on tasks · not scored

Download as PDF

Prove /bin and /usr/bin are one place, read your hardware with cat and grep, pick the right manual section for crontab and trace packages back to Debian, Ubuntu or Mint.

Work these before the self assessment. Each has a stated outcome you can verify for yourself. Attempt it properly first - open its model answer only once you have something, or once you are genuinely stuck. There is often more than one correct answer.

Prove that /bin and /usr/bin are the same place

Using ls -l, show that /bin is a symbolic link, and identify what it points to. Then confirm that a command found in one path is the same file in the other.

How to check: You can state what /bin points to, and demonstrate that /bin/ls and /usr/bin/ls are the same file.

Read your hardware without any special tool

Using only cat and grep, find out: how many CPU cores the machine has, what the processor model is, and how much total memory is installed. Do not use lscpu, free or inxi - read the kernel interfaces directly.

How to check: Three facts, each obtained from a file under /proc. Cross-check with lscpu and free -h afterwards to confirm you read them correctly.

Find the right manual page when the name is ambiguous

Find out how many manual sections document something called crontab, then use the correct one to answer this question: in a crontab file, what do the five time fields represent, in order?

How to check: You can name the two sections involved, explain how they differ, and list the five fields in order.

Trace a file back to the layer it came from

Determine which of the three layers - Debian, Ubuntu or Mint - supplied timeshift and which supplied grep. Use apt policy, and read the repository line in the output.

How to check: You can name the repository each package came from and explain what that tells you about the package's origin and portability.

Show the model answer

Prove that /bin and /usr/bin are the same place

bash
$ ls -l / | grep '^l'
lrwxrwxrwx  1 root root    7 Apr 22  2024 bin -> usr/bin
lrwxrwxrwx  1 root root    7 Apr 22  2024 lib -> usr/lib
lrwxrwxrwx  1 root root    8 Apr 22  2024 sbin -> usr/sbin
$ ls -i /bin/ls /usr/bin/ls
2097374 /bin/ls   2097374 /usr/bin/ls

The l at the start of the permission string marks a symbolic link, and the arrow shows the target. The clinching evidence is ls -i, which prints the inode number - the filesystem's internal identifier. Identical inode numbers mean it is one single file reachable by two paths, not two copies.

Module 4 covers inodes and links properly. For now the point is that the usr-merge is real: these are not duplicates.

Read your hardware without any special tool

bash
$ grep -c '^processor' /proc/cpuinfo
4
$ grep -m1 'model name' /proc/cpuinfo
model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
$ grep MemTotal /proc/meminfo
MemTotal:        8039424 kB

grep -c counts matching lines rather than printing them, and each logical processor gets its own processor line. -m1 stops after the first match, since the model name repeats once per core.

Note that MemTotal is in kilobytes and reads slightly below the installed amount - firmware and integrated graphics reserve some before the kernel ever sees it. This is why free -h on an 8 GB machine reports about 7.7 GiB, which is normal rather than a fault.

The wider point: lscpu and free are conveniences that read exactly these files. Knowing the underlying source means you can script against it when no convenient tool exists.

Find the right manual page when the name is ambiguous

bash
$ man -f crontab
crontab (1)          - maintain crontab files for individual users
crontab (5)          - tables for driving cron
$ man 5 crontab
then press / and search for "field" to jump straight to it

Section 1 documents the command you run to edit your schedule. Section 5 documents the file format - which is what the question actually asked about. Plain man crontab would have given you section 1 and left you hunting.

The five fields, in order: minute, hour, day of month, month, day of week.

This pattern - command in section 1, its file format in section 5 - recurs throughout the system: passwd, group, fstab, hosts, sudoers. Whenever you need to understand a configuration file rather than a command, try section 5 first.

Trace a file back to the layer it came from

bash
$ apt policy timeshift
timeshift:
  Installed: 24.06.1
  Version table:
 *** 24.06.1 700
        700 https://packages.linuxmint.com xia/main amd64 Packages
$ apt policy grep
grep:
  Installed: 3.11-4build1
  Version table:
 *** 3.11-4build1 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

timeshift comes from packages.linuxmint.com - it is Mint's own, and you would not find it on a stock Debian or Ubuntu system. grep comes from the Ubuntu archive, and Ubuntu in turn took it from Debian, where it has been packaged for thirty years.

The number beside each entry (700, 500) is the pin priority, which is how APT decides between repositories offering the same package. Mint's repository is deliberately given a higher priority than Ubuntu's so that Mint's own versions win. Module 8 covers this properly - it is the mechanism behind the Snap block you met in the beginner course.

Your exact versions and codenames will differ. What matters is reading the hostname in the source line.