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.
The __________ command in Linux allows mounting of NFS shared directories.
- mount
- nfs
- fstab
- showmount
The mount command in Linux allows mounting of NFS (Network File System) shared directories. You can use this command to make remote file systems accessible on your local system through NFS.
To iterate over a range of numbers in a loop, one might use the seq command combined with the _________ loop.
- for
- while
- until
- numeric
To iterate over a range of numbers in a loop, one might use the seq command combined with the for loop. The seq command generates a sequence of numbers, and the "for" loop can be used to loop through these numbers, allowing you to perform actions on each number within the specified range. This is a common technique in shell scripting for tasks like counting or iterating through numerical data.
A company wants to deploy a microservices architecture for their application. They are looking for a technology that can package each service with its dependencies and configuration in a reproducible way. Which technology would best fit this requirement?
- Docker
- Kubernetes
- Vagrant
- Helm
Docker is a technology that allows you to package applications and their dependencies into containers. It's an excellent choice for deploying microservices, as it ensures that each service is encapsulated with its dependencies and configurations, making it highly reproducible and scalable.
Which command tests for file types and compares values in Bash scripting?
- test
- eval
- exec
- check
In Bash scripting, the test command is used to test for file types and compare values. It is often used with conditional statements like if and elif to perform tests on files, strings, and other expressions. The test command is also equivalent to [ ] in Bash.
What is the primary purpose of the /home directory in Linux?
- Storing system binaries
- Storing system configuration files
- Storing temporary files
- Storing user home directories
The primary purpose of the /home directory in Linux is to store user home directories. Each user on a Linux system typically has a subdirectory within /home where their personal files and settings are stored.
During the boot process, the ________ is responsible for loading the kernel into memory.
- bootloader
- init system
- BIOS/UEFI
- kernel
During the boot process, the BIOS/UEFI (Basic Input/Output System/Unified Extensible Firmware Interface) is responsible for loading the kernel into memory. The BIOS/UEFI is the firmware that initializes the hardware and starts the boot process. It locates the bootloader, which, in turn, loads the kernel into memory to start the operating system.