System & Networking Questions with Answers

16 practice questions on System & Networking (Linux & Shell) with answers and step-by-step solutions. Try 10 samples below, then practise all 16 free in the AptiNest app.

Sample questions

Question 1Easy

Which command shows free and used RAM?

  1. df -h
  2. du -h
  3. free -h
  4. uptime -r

Answer: C. free -h

Explanation

free reports memory and swap. df is for disks.

Step-by-step solution

  1. Memory is RAM.
  2. free shows it.
  3. -h makes it readable.

Why the other options are wrong

  • A. df shows filesystems.
  • B. du shows directory usage.
  • D. uptime shows load.

Question 2Easy

Which command prints the kernel version?

  1. kernel -v
  2. ver
  3. uname -r
  4. lsb_release -k

Answer: C. uname -r

Explanation

uname -r prints the kernel release and uname -a prints everything.

Step-by-step solution

  1. uname = Unix name.
  2. -r = release.
  3. -a = all.

Why the other options are wrong

  • A. Not a command.
  • B. DOS command.
  • D. Not an option.

Question 3Easy

Which command shows disk space usage of file systems?

  1. du -h
  2. free -m
  3. lsblk -f
  4. df -h

Answer: D. df -h

Explanation

df reports file system usage; du reports usage of files and directories.

Step-by-step solution

  1. Df command shows disk space used by file systems.
  2. Df -h adds human-readable format for easier understanding.
  3. Other options like du or free show different types of data.
  4. Lsblk is for block device information, not disk usage.
  5. Correct answer is df -h.

Why the other options are wrong

  • A. du -h shows space used by files and folders, not the space free on each file system.
  • B. free -m reports RAM and swap memory, not disk space on file systems.
  • C. lsblk lists block devices and their file systems, but does not report the space used.

Tip: Remember: df shows disk usage, du shows directory size.

Question 4Easy

Which command extracts a gzip-compressed tar archive backup.tar.gz?

  1. tar -czf backup.tar.gz
  2. tar -tzf backup.tar.gz
  3. tar -xzf backup.tar.gz
  4. gzip -x backup.tar.gz

Answer: C. tar -xzf backup.tar.gz

Explanation

x extract, z gzip, f file. c would create and t would list.

Step-by-step solution

  1. x means extract.
  2. z handles gzip.
  3. f names the file.

Why the other options are wrong

  • A. -c creates.
  • B. -t lists.
  • D. gzip -d decompresses.

Question 5Medium

Which command shows TCP/UDP ports being listened on, with process names (modern iproute2 tool)?

  1. ss -tulpn
  2. ifconfig -p
  3. ping -l
  4. ip route -t

Answer: A. ss -tulpn

Explanation

ss replaced netstat: -t TCP, -u UDP, -l listening, -p process, -n numeric.

Step-by-step solution

  1. Use ss.
  2. Flags select protocol and state.
  3. Needs root for others' process names.

Why the other options are wrong

  • B. ifconfig shows interfaces.
  • C. ping tests reachability.
  • D. ip route shows routes.

Question 6Medium

What do the three numbers in load average: 0.5, 1.2, 2.0 from uptime mean?

  1. The average load over the last 1, 5 and 15 minutes
  2. CPU use of the last 3 users
  3. Memory use in GB
  4. Number of cores

Answer: A. The average load over the last 1, 5 and 15 minutes

Explanation

Load counts processes running or waiting for CPU/IO. Compare it to the core count.

Step-by-step solution

  1. Three windows.
  2. 1, 5 and 15 minutes.
  3. Compare with the number of cores.

Why the other options are wrong

  • B. Not per user.
  • C. Not memory.
  • D. Cores come from nproc.

Question 7Medium

Which command shows only the last lines of the systemd journal for a service and follows new entries?

  1. systemctl log nginx
  2. journalctl -u nginx -f
  3. tail /etc/nginx
  4. dmesg -u nginx

Answer: B. journalctl -u nginx -f

Explanation

journalctl -u <unit> filters by unit and -f follows live.

Step-by-step solution

  1. journalctl reads the journal.
  2. -u picks the unit.
  3. -f follows.

Why the other options are wrong

  • A. Not a systemctl command.
  • C. Config directory, not logs.
  • D. dmesg shows kernel messages.

Question 8Medium

Which command tests reachability of a host by sending ICMP echo requests?

  1. curl
  2. ping
  3. traceroute -I -d
  4. nslookup

Answer: B. ping

Explanation

ping host sends echo requests and prints round-trip times. traceroute shows hops.

Step-by-step solution

  1. Send ICMP echo.
  2. Receive replies.
  3. See round-trip time.

Why the other options are wrong

  • A. curl makes HTTP requests.
  • C. Traceroute shows the path.
  • D. nslookup resolves names.

Question 9Medium

Which command shows memory usage in Linux?

  1. mem
  2. df
  3. free
  4. uptime -m

Answer: C. free

Explanation

free -h shows total, used and available RAM and swap.

Step-by-step solution

  1. Free shows the total, used and free RAM and swap memory.
  2. Mem, df and uptime are not Linux memory commands.
  3. So the answer is free.

Why the other options are wrong

  • A. Mem is not a standard Linux command.
  • B. Df shows disk space usage, not memory.
  • D. Uptime -m is not a valid option for memory; uptime shows load and time running.

Tip: Free -h shows memory in human-readable units.

Question 10Hard

Which command copies a.txt to /tmp on host srv over SSH?

  1. ssh a.txt user@srv:/tmp
  2. cp a.txt user@srv:/tmp
  3. scp a.txt user@srv:/tmp
  4. sftp -r a.txt

Answer: C. scp a.txt user@srv:/tmp

Explanation

scp is secure copy; user@host:path names the remote path.

Step-by-step solution

  1. Local source first.
  2. Remote target after.
  3. user@host:path format.

Why the other options are wrong

  • A. ssh runs commands, not copies.
  • B. cp is local only.
  • D. Not the right syntax.

Practise all 16 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Linux & Shell topics · All topics