Which command can be used to query DNS records, including MX, NS, and SOA records?
- nslookup
- ifconfig
- route
- ping
The nslookup command can be used to query DNS (Domain Name System) records, including MX (Mail Exchange), NS (Name Server), and SOA (Start of Authority) records. It's a valuable tool for DNS troubleshooting and network diagnostics.
A colleague informs you that they're unable to access a service on a remote server. You suspect it might be a firewall issue. How would you list the current firewall rules to diagnose the issue?
- iptables -L
- firewall-cmd --list-all
- ufw status
- netstat -an
To list the current firewall rules on a Linux system using iptables, you can use the command iptables -L. This command will display the current firewall rules, allowing you to diagnose potential issues and ensure that the necessary ports are open for the service your colleague is trying to access.
When you want to continue to the next iteration of a loop without executing the subsequent commands in the current iteration, you use the __________ command.
- continue
- break
- exit
- return
When you want to continue to the next iteration of a loop without executing the subsequent commands in the current iteration, you use the **continue** command. It allows you to skip the current iteration and proceed to the next iteration of the loop.
Which column in the top command output represents the percentage of CPU usage for a process?
- %CPU
- %MEM
- PID
- COMMAND
In the top command output, the %CPU column represents the percentage of CPU usage for each process. This column shows the proportion of CPU resources that a process is currently utilizing.
After a recent system update, your Linux server fails to boot properly. It seems to hang after the bootloader phase. Where would you begin troubleshooting to identify the issue?
- Initiate a rescue mode
- Check the system logs in /var/log
- Run a hardware diagnostic tool
- Reinstall the operating system
When a Linux server fails to boot after an update, you should begin troubleshooting by checking the system logs in /var/log. Specifically, you can look at logs such as /var/log/syslog and /var/log/boot.log to identify any error messages or issues that occurred during the boot process.
What is the first program run by the Linux kernel when it starts?
- init
- shell
- bootloader
- BIOS/UEFI
The first program run by the Linux kernel when it starts is typically the init program (or its modern replacement, such as systemd). Init is responsible for initializing the system, starting services, and setting up the user environment.
If you need to view the route taken by packets to reach a network host, which command would you use?
- traceroute
- ifconfig
- netstat
- ping
To view the route taken by packets to reach a network host, you would use the traceroute command. Traceroute provides a detailed path analysis of how packets traverse the network, including the IP addresses of each hop and response times. It's a valuable tool for diagnosing network issues.
Which file in Linux is used to set the hostname and the order in which the system resolves addresses?
- /etc/hostname
- /etc/hosts
- /etc/resolv.conf
- /etc/networks
The /etc/hosts file is used to set the hostname and the order in which the system resolves addresses. It contains mappings of IP addresses to hostnames and can be used to define the local system's hostname.
The command used to resize the filesystem on a partition in Linux is _________.
- resize2fs
- mv
- chmod
- cp
The command used to resize the filesystem on a partition in Linux is resize2fs. This command is used after resizing a partition to adjust the filesystem to use the newly available space.
A user reports that their application occasionally freezes. You suspect it's due to the application waiting for some I/O operations to complete. Which state might the process be in during these freezes?
- D (Uninterruptible Sleep)
- R (Running)
- S (Sleeping)
- Z (Zombie)
During an I/O operation, a process might enter the "D" state, which stands for Uninterruptible Sleep. This state indicates that the process is waiting for a resource to become available, and it cannot be interrupted. It's often associated with I/O-related delays or problems.