Quiz Module 12 - Advanced Administration
Instructions
This quiz contains 30 multiple-choice questions to validate your understanding of Module 12.
Tip: Answer each question before revealing the answer. The answers are hidden just after each question.
Question 1
Which command allows you to create a full backup of a Linux system?
See explanation
Correct answer: tar, rsync, or specialized tools
Explanation: tar creates archives. rsync synchronizes files. For full backups, use tar with exclusions, rsync for synchronization, or tools like backupninja, Bacula, Amanda. Schedule with cron or systemd timers.
Question 2
Which command allows you to synchronize files between systems?
See explanation
Correct answer: rsync
Explanation: rsync efficiently synchronizes files (only copies differences). Examples: rsync -av source/ dest/, rsync -avz user@host:/source/ /dest/ (via SSH). Options: -a (archive), -v (verbose), -z (compression).
Question 3
Which command allows you to optimize disk performance (I/O)?
See explanation
Correct answer: iostat, ionice, or kernel parameter tuning
Explanation: iostat shows I/O statistics. ionice adjusts I/O priority. Kernel tuning: /sys/block/sda/queue/scheduler (noop, deadline, cfq). hdparm to optimize IDE/SATA disks. tune2fs for ext filesystems.
Question 4
Which command allows you to optimize network performance?
See explanation
Correct answer: sysctl (kernel parameters) or ethtool
Explanation: sysctl modifies network kernel parameters (TCP buffer sizes, etc.). ethtool configures network interfaces (speed, duplex). Files: /etc/sysctl.conf, /proc/sys/net/. Example: sysctl -w net.core.rmem_max=16777216.
Question 5
Which command allows you to see modifiable kernel parameters?
See explanation
Correct answer: sysctl -a
Explanation: sysctl -a displays all modifiable kernel parameters. sysctl parameter.name shows a specific parameter. sysctl -w parameter.name=value temporarily modifies. To make the change permanent, edit /etc/sysctl.conf.
Question 6
Which command allows you to create a compressed tar archive?
See explanation
Correct answer: tar -czf
Explanation: tar -czf archive.tar.gz folder/ creates a compressed archive with gzip. Options: -c (create), -z (gzip), -f (file). tar -xzf archive.tar.gz extracts. tar -cjf uses bzip2, tar -cJf uses xz.
Question 7
Which command allows you to see system resource usage continuously?
See explanation
Correct answer: watch -n 1 'command' or sar
Explanation: watch -n 1 'free -h' runs a command every second. sar collects and displays historical statistics. vmstat 2 displays stats every 2 seconds. Useful for continuous monitoring.
Question 8
Which command allows you to see processes with their threads?
See explanation
Correct answer: ps -eLf or top -H
Explanation: ps -eLf displays all processes with their threads (LWP = Light Weight Process). top -H shows threads in top. htop with H also enables thread display. Useful for diagnosing performance issues.
Question 9
Which command allows you to see files opened by a process?
See explanation
Correct answer: lsof -p PID
Explanation: lsof -p 1234 displays all files opened by the process with PID 1234. lsof /path shows processes using a file. lsof -i shows network files. Useful for seeing used resources.
Question 10
Which command allows you to see a process's resource limits?
See explanation
Correct answer: ulimit -a or cat /proc/PID/limits
Explanation: ulimit -a displays the current shell's resource limits. cat /proc/PID/limits shows a specific process's limits. /etc/security/limits.conf configures system limits. Useful for diagnosing resource issues.
Question 11
Which command allows you to see CPU usage statistics per core?
See explanation
Correct answer: mpstat or top (press 1)
Explanation: mpstat displays CPU statistics per core. mpstat -P ALL shows all cores. In top, press 1 to see individual CPUs. Useful for checking if load is well distributed among cores.
Question 12
Which command allows you to see processes with detailed memory usage?
See explanation
Correct answer: ps aux --sort=-%mem or pmap
Explanation: ps aux --sort=-%mem sorts by memory. pmap -d PID shows a process's detailed memory map (RSS, shared, private). cat /proc/PID/smaps also shows memory details. Useful for analyzing memory leaks.
Question 13
Which command allows you to see I/O statistics per process?
See explanation
Correct answer: iotop or pidstat -d
Explanation: iotop displays I/O usage per process in real-time (like top for I/O). pidstat -d also shows I/O statistics per process. Requires sudo. Useful for identifying I/O intensive processes.
Question 14
Which command allows you to see network connections per process?
See explanation
Correct answer: ss -tulpn or netstat -tulpn
Explanation: ss -tulpn or netstat -tulpn displays network connections with process PIDs. -p shows processes, -n avoids DNS resolution. Useful for seeing which processes are communicating over the network.
Question 15
Which command allows you to see historical system statistics with sar?
See explanation
Correct answer: sar -f /var/log/sa/saXX
Explanation: sar -f /var/log/sa/sa01 reads historical statistics from day 1. sar -u -f /var/log/sa/sa01 shows CPU. sar -r shows memory, sar -d shows disk. Requires sysstat installed and sadc configured to collect.
Question 16
Which command allows you to create an automation script for backups?
See explanation
Correct answer: Create a Bash script with tar/rsync and schedule with cron
Explanation: Create a Bash script (#!/bin/bash) using tar or rsync for backups. Schedule it with crontab -e or a systemd.timer. Example: 0 2 * * * /usr/local/bin/backup.sh (every day at 2am). Test manually first!
Question 17
Which command allows you to see system performance with detailed metrics?
See explanation
Correct answer: perf, sar, or monitoring tools (Prometheus, Grafana)
Explanation: perf is an advanced system profiler. sar collects statistics. For production, use tools like Prometheus + Grafana for continuous monitoring. htop, iotop, nethogs for real-time monitoring.
Question 18
Which command allows you to see processes with detailed CPU usage?
See explanation
Correct answer: pidstat -u or top
Explanation: pidstat -u displays CPU usage per process. pidstat -u 2 every 2 seconds. top or htop also show real-time CPU usage. Useful for identifying resource-intensive processes.
Question 19
Which command allows you to see detailed network statistics per interface?
See explanation
Correct answer: ip -s link or ifconfig
Explanation: ip -s link or ip -s -s link displays detailed statistics per interface (packets, errors, collisions). ifconfig also shows statistics. ethtool -S eth0 shows even more detailed statistics.
Question 20
Which command allows you to see processes with their memory usage by type (RSS, VSZ)?
See explanation
Correct answer: ps aux (RSS, VSZ columns) or pmap
Explanation: ps aux displays RSS (physical memory) and VSZ (virtual memory). pmap -d PID shows the detailed memory map. RSS = actually used, VSZ = total allocated. Useful for analyzing memory usage.
Question 21
Which command allows you to see real-time system statistics with continuous updates?
See explanation
Correct answer: vmstat 2 or sar 2
Explanation: vmstat 2 displays system statistics every 2 seconds. sar 2 does the same with sar. iostat 2 for I/O. Useful for continuous monitoring. Ctrl+C to stop.
Question 22
Which command allows you to see processes with their tree and resource usage?
See explanation
Correct answer: htop (with tree) or pstree with ps
Explanation: htop with F5 displays the process tree with resource usage. pstree -p shows the tree with PIDs. ps auxf also shows the tree. Useful for seeing parent-child relationships.
Question 23
Which command allows you to see disk usage statistics per process?
See explanation
Correct answer: iotop or lsof + du
Explanation: iotop displays disk I/O usage per process in real-time. lsof -p PID shows open files, then du to see size. Useful for identifying processes that use a lot of disk.
Question 24
Which command allows you to see network statistics per process?
See explanation
Correct answer: nethogs or ss/netstat with lsof
Explanation: nethogs displays network usage per process in real-time (like top for network). ss -tulpn or netstat -tulpn with lsof also show connections per process. Useful for identifying network-intensive processes.
Question 25
Which command allows you to create a complete automation script with cron and monitoring?
See explanation
Correct answer: Create a Bash script with logging, errors, and schedule with cron/systemd timer
Explanation: Create a robust Bash script with error handling (set -e), logging (>> logfile 2>&1), and notifications. Schedule with crontab -e or systemd.timer. Test manually first. Add checks and alerts.
Question 26
Which command allows you to see system performance with graphs?
See explanation
Correct answer: Monitoring tools (Grafana, Munin, Cacti) or sar with scripts
Explanation: For graphs, use Grafana (with Prometheus), Munin, or Cacti. sar collects data, then visualize with tools. For production, a complete monitoring system is recommended to track trends.
Question 27
Which command allows you to see system statistics with a summary by category?
See explanation
Correct answer: dstat or glances
Explanation: dstat displays a summary of system statistics (CPU, disk, network, etc.) in one view. glances is a complete monitoring tool with a modern interface. htop also shows a good summary. Useful for a quick overview.
Question 28
Which command allows you to see processes with their combined CPU and memory usage?
See explanation
Correct answer: top, htop, or ps with custom sorting
Explanation: top and htop display CPU and memory together. ps aux also shows both. ps aux --sort=-%cpu,-%mem sorts by CPU then memory. Useful for identifying processes using a lot of resources.
Question 29
Which command allows you to create an automated monitoring system with alerts?
See explanation
Correct answer: Bash scripts with cron + tools (Nagios, Zabbix, Prometheus) or custom scripts
Explanation: Create Bash scripts that check metrics (CPU, memory, disk) and send alerts (email, Slack, etc.) if thresholds are exceeded. Schedule with cron. For production, use Nagios, Zabbix, or Prometheus + Alertmanager.
Question 30
Which command allows you to see a complete summary of system performance?
See explanation
Correct answer: glances, htop, or combination of commands (free, df, uptime, etc.)
Explanation: glances displays a complete summary (CPU, memory, disk, network, processes). htop also. Or combine: free -h && df -h && uptime && ps aux --sort=-%mem | head -5. Create a script for a custom summary.
Quiz Result
Congratulations on completing the Module 12 quiz!
Score:
- 25-30 correct answers: Excellent! You master advanced Linux administration.
- 20-24 correct answers: Very good! Review the concepts where you had difficulties.
- 15-19 correct answers: Good! Review the chapters on advanced administration.
- Less than 15: Recommended to review the module before continuing.
Next Steps
Congratulations! You have completed all the modules of the Linux training!
Final Project: Put all your knowledge into practice with the final project of Module 12
Resources: Continue to practice and explore advanced Linux features
Quiz created on: December 2024 - Tested on Ubuntu 24.04