CompTIA Linux+ (XK0-006) — All Questions

← Back to practice

6 questions

Troubleshooting

Which journalctl command shows kernel messages from the current boot only?

  • a.journalctl --disk-usage
  • b.journalctl -f
  • c.journalctl -k -b
  • d.journalctl --vacuum-time=1d

'journalctl -k' limits output to kernel messages (like dmesg) and '-b' limits it to the current boot, so '-k -b' shows this boot's kernel log. '-f' follows new entries, and '--vacuum-time' deletes old journal data rather than displaying it.

Troubleshooting

A process is consuming excessive CPU. Which command lets you interactively view and sort running processes by CPU usage in real time?

  • a.top
  • b.free
  • c.uptime
  • d.vmstat

'top' provides a live, interactive view of processes and can sort by CPU or memory usage. 'free' shows memory, 'uptime' shows load averages, and 'vmstat' prints periodic system statistics but is not an interactive process browser.

Troubleshooting

Which command shows listening TCP sockets along with the process holding each socket?

  • a.ping -c 4 localhost
  • b.ip addr show
  • c.dig example.com
  • d.ss -tlnp

'ss -tlnp' lists TCP (-t) listening (-l) sockets numerically (-n) with the owning process (-p). 'ip addr' shows interface addresses, 'ping' tests reachability, and 'dig' performs DNS lookups.

Troubleshooting

Users cannot resolve hostnames but can reach servers by IP. Which command directly tests DNS resolution?

  • a.ip route
  • b.dig www.example.com
  • c.ss -s
  • d.traceroute 8.8.8.8

'dig' queries DNS servers and returns resolution details, making it the direct tool for diagnosing name-resolution problems. 'ip route' inspects the routing table, 'ss -s' shows socket statistics, and 'traceroute' maps the network path by IP.

Troubleshooting

A filesystem reports 'No space left on device' but 'df -h' shows free space. Which command helps identify inode exhaustion?

  • a.du -sh /
  • b.lsof +L1
  • c.df -i
  • d.mount -a

'df -i' reports inode usage; a filesystem can run out of inodes (often from many tiny files) while still showing free blocks. 'du' measures space consumed, 'lsof +L1' finds deleted-but-open files, and 'mount -a' remounts fstab entries.

Troubleshooting

Which command sends the default TERM signal to a process by PID, allowing it to shut down gracefully?

  • a.kill 1234
  • b.kill -9 1234
  • c.kill -STOP 1234
  • d.kill -HUP 1234

'kill 1234' with no signal sends SIGTERM (15), which asks the process to terminate gracefully so it can clean up. 'kill -9' sends SIGKILL which cannot be caught, '-STOP' pauses the process, and '-HUP' typically triggers a reload.

Report