Free Linux Foundation Certified System Administrator by Sysadmin Questions and Answers — Questions and Answers
Question 1: Define Bash
- Prevent shell from executing any Spell characters
- Used to determine information about Various commands
- Treats character in front as Single quotes
- Most commonly used shell for Linux distros. (Correct answer)
Correct answer: Most commonly used shell for Linux distros.
Bash, or Bourne Again SHell, is correctly defined as the most commonly used shell for Linux distributions. It serves as a command-line interpreter, allowing users to execute commands, run scripts, and interact with the operating system. Its widespread adoption and rich feature set make it a fundamental tool for system administration and scripting in the Linux environment.
Question 2: Which find command line parameter would be used to limit the command to searching down a specific number of subdirectories in a nested directory structure?
- -n
- --maxdepth (Correct answer)
- --maxlevels
- --dirmax
Correct answer: --maxdepth
The `find` command line parameter used to limit the search depth to a specific number of subdirectories is `--maxdepth`. This parameter takes an integer value, instructing `find` not to descend more than that many levels below the starting directory. This is crucial for controlling the scope of a search, improving performance, and preventing `find` from traversing excessively deep or irrelevant parts of the filesystem.
Question 3: Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
- paste -f 1,4 /etc/passwd
- cut -d : -f 1,4 /etc/passwd (Correct answer)
- split -c 1,4 /etc/passwd
- fmt -f 1,4 /etc/passwd
Correct answer: cut -d : -f 1,4 /etc/passwd
The `cut` command is the correct utility to extract specific columns from a file. With the `/etc/passwd` file, fields are delimited by colons. The `-d :` option specifies the colon as the delimiter, and `-f 1,4` instructs `cut` to extract the first and fourth fields, which correspond to the username and primary group ID, respectively. This accurately fulfills the requirement to print a list of usernames and their primary groups.
Question 4: Which input must be given to ifconfig in order to turn on a network interface that was previously inactive?
- on
- enable
- up (Correct answer)
- activate
Correct answer: up
To turn on a network interface that was previously inactive using `ifconfig`, the input `up` must be given. For example, `ifconfig eth0 up` activates the `eth0` interface. This command configures the interface to be operational, allowing it to send and receive network traffic, which is essential for network connectivity.
Question 5: Which environment variable among the following modifies or expands the list of directories containing shared libraries?
- LD_SHARE_PATH
- LD_LIBRARY_PATH (Correct answer)
- LD_LIB_PATH
- LD_LOAD_PATH
Correct answer: LD_LIBRARY_PATH
The environment variable that modifies or expands the list of directories containing shared libraries is `LD_LIBRARY_PATH`. This variable specifies a colon-separated list of directories that the dynamic linker should search for shared libraries before the standard system paths. It is commonly used to point applications to custom or non-standard library locations, especially during development or when using specific software versions.
Question 6: In which of the directories can you find man pages that are compliant with the FHS?
- /opt/man
- /usr/share/man (Correct answer)
- /var/pkg/man
- /usr/doc/
Correct answer: /usr/share/man
According to the Filesystem Hierarchy Standard (FHS), the `/usr/share/man` directory is the standard location for manual pages (man pages) on Linux systems. This directory typically contains subdirectories organized by man page section (e.g., `man1`, `man8`) and locale, providing a consistent and organized structure for system documentation.
Question 7: Which of the following commands moves and restarts the most recent shell task in the background?
- run
- back
- bg (Correct answer)
- fg
Correct answer: bg
The `bg` command is used to move and restart the most recent shell task in the background. When a job is stopped (e.g., using Ctrl+Z), `bg` resumes its execution in the background, allowing the user to continue interacting with the shell. This is a fundamental command for job control in Unix-like operating systems.
Define Bash