Challenge your understanding of networking and system monitoring with Bash using real-world scenarios and essential commands. This quiz covers practical Bash techniques for analyzing systems, checking connectivity, and monitoring system resources effectively.
Which Bash command is commonly used to check if a remote server at 192.168.1.5 is reachable from your system?
Explanation: The 'ping' command is designed to test network connectivity between your machine and another host. 'checknet' and 'reach' are not valid standard Bash commands, so they would return an error. 'netstat' is used for viewing network connections and listening ports, not for checking connectivity to a specific host.
What Bash command lists all the current open listening TCP and UDP ports on your system?
Explanation: The 'netstat -tuln' command displays all TCP and UDP listening ports in a numbered format. 'ifconfig -a' shows network interface configurations, not open ports. 'curl --list' is not a valid option and 'portscan' is not a built-in Bash command.
Which command in Bash can you use to view real-time system processes and resource usage?
Explanation: 'top' provides real-time information about system processes and resource utilization. 'tree' displays directory structure, 'cat' reads file contents, and 'move' is not a standard Bash command for either operation.
What Bash command gives a brief summary of CPU, memory, and swap usage on most Unix systems?
Explanation: 'free -h' shows a human-readable summary of memory, swap, and buffer usage. 'ps aux' lists processes, not a resource summary. 'head -n 1' outputs the first line of a file, and 'diskuse' is not a standard command.
How can you display the IP addresses assigned to your network interfaces using a Bash command?
Explanation: 'ip addr show' is used to list all IP addresses for your machine's interfaces. 'address find', 'netview', and 'list-ip' are not standard Bash commands for this task, and would not return the desired information.
Which command shows the disk usage of all mounted filesystems in a human-readable format?
Explanation: 'df -h' displays all mounted filesystems and their usage in human-friendly units. 'lsblk -a' lists block devices, not usage. 'du -a' shows usage for individual files and directories, not overall filesystems. 'disks -l' is not a standard Bash command.
What command can you use in Bash to capture and analyze live network traffic on the eth0 interface?
Explanation: 'tcpdump -i eth0' captures and prints packets transmitted on the eth0 interface. 'scanport' and 'peeknet' are not standard Bash commands, and 'trafficmon --live' is not a recognized command for network traffic analysis.
Which Bash command displays the last 20 lines of the /var/log/syslog file?
Explanation: 'tail -n 20' prints the final 20 lines of the specified file. 'less -20' is incorrect syntax; 'less' is for browsing entire files. 'showlast' and 'endview' are not standard Bash commands and would result in command not found errors.
Which command lists all currently established TCP connections on your system?
Explanation: 'ss -t state established' displays active TCP connections. 'route -a' shows the routing table. 'ftpstat' and 'tcpviewer' are not standard Bash commands for checking established TCP connections.
Which Bash command reports the duration that the system has been running without a reboot?
Explanation: 'uptime' shows how long the system has been active. 'runtime', 'sysstatus', and 'lastboot' are not standard Bash commands for this function, and would generate errors if used as written.