Linux System Administration and Shell Scripting
Test your knowledge of Linux operating system commands, file system management, file permissions, user administration, and shell scripting fundamentals including loops, functions, and I/O redirection.
Questions
Which of the following are syntax that can be used to declare a function?
- function_name() {command-list }
- function_name ( ) { }
- function name (command list ) {
- None
"Which of these commands redirects the output of cat testfile to redirfile without overwriting the contents of redirfile? "
- cat testfile >redirfile
- cat testfile >>redirfile
- cat testfile 1> redirfile
- cat testfile 2> redirfile
"What stream usually outputs error messages to the screen? "
- stdout
- stderr
- stderr2
- stdouterr
"The command is used within a function to exit the function with a given status. "
- "local
- " function
- "return
- "parameter
"Which directory is the standard for storing shell scripts created by systems adminstrators? "
- /etc
- /bin
- /dev
- /rc.d
"What does the read command do while it waits for input? "
- Tests for command-line arguments
- Shifts arguments to the left
- Exits the program
- Creates a pause in the program
"The ______ loop executes as long as the condition returns an exit status of zero, whereas the _______ loop executes unless the condition returns a zero exit status. "
- while,until
- until, while
- repeat, while
- None
"Which command do you use to make the /etc/inputrc file immutable? "
- chattr +i /etc/inputrc
- chmod 666 inputrc
- chmod g=rw inputrc
- None
What Linux file would you use when performing a rescue after a hard disk problem occurs?
- /dev/hda1
- /dev/null
- /dev/ram
- /dev/tty
"Which group of letters are the file permissions that apply to a group in the string r--r-xrwx? "
- r--
- r -x
- rwx
- None
"Which command will create a hard link named ""Link"" to the ""Test"" file? "
- ln -s Test Link
- ln Test Link
- ln / Link Test
- ln -h Link Test
What does the command umask 123 do?
- It sets file owner permissions to read and write
- It sets the permissions of other users to read
- It sets group permissions to read and execute
- All of them
User's with user id as 0 (Zero) are
- Printer users
- Not allowed to login using rlogin/ssh
- root users
- User id cannot be 0
User's passwords are generally stored in
- /etc/passwd
- /var/passwd
- /etc/password
- /var/password
What is the purpose of sync command?
- To synchronize user applications
- To synchronize keyboard and monitor
- To synchornize disk buffers
- To syschronize main memory and cache memory
How to mount a file system?
- fsck
- fsmount
- mount
- mountfs
"Count the number of errors in the statement if [password = password1] then echo password else password"
- 0
- 4
- 1
- 2
The valid conditional operator
- -NE
- -GT
- -LT
- -eq
The option not allowed in test command
- -d
- -l
- `-u
- -a
linux allows more than one root directory
- True
- False