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.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following are syntax that can be used to declare a function?

  1. function_name() {command-list }
  2. function_name ( ) { }
  3. function name (command list ) {
  4. None
Question 2 Multiple Choice (Single Answer)

"Which of these commands redirects the output of cat testfile to redirfile without overwriting the contents of redirfile? "

  1. cat testfile >redirfile
  2. cat testfile >>redirfile
  3. cat testfile 1> redirfile
  4. cat testfile 2> redirfile
Question 3 Multiple Choice (Single Answer)

"What stream usually outputs error messages to the screen? "

  1. stdout
  2. stderr
  3. stderr2
  4. stdouterr
Question 4 Multiple Choice (Single Answer)

"The command is used within a function to exit the function with a given status. "

  1. "local
  2. " function
  3. "return
  4. "parameter
Question 5 Multiple Choice (Single Answer)

"Which directory is the standard for storing shell scripts created by systems adminstrators? "

  1. /etc
  2. /bin
  3. /dev
  4. /rc.d
Question 6 Multiple Choice (Single Answer)

"What does the read command do while it waits for input? "

  1. Tests for command-line arguments
  2. Shifts arguments to the left
  3. Exits the program
  4. Creates a pause in the program
Question 7 Multiple Choice (Single Answer)

"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. "

  1. while,until
  2. until, while
  3. repeat, while
  4. None
Question 8 Multiple Choice (Single Answer)

"Which command do you use to make the /etc/inputrc file immutable? "

  1. chattr +i /etc/inputrc
  2. chmod 666 inputrc
  3. chmod g=rw inputrc
  4. None
Question 9 Multiple Choice (Single Answer)

What Linux file would you use when performing a rescue after a hard disk problem occurs?

  1. /dev/hda1
  2. /dev/null
  3. /dev/ram
  4. /dev/tty
Question 10 Multiple Choice (Single Answer)

"Which group of letters are the file permissions that apply to a group in the string r--r-xrwx? "

  1. r--
  2. r -x
  3. rwx
  4. None
Question 11 Multiple Choice (Single Answer)

"Which command will create a hard link named ""Link"" to the ""Test"" file? "

  1. ln -s Test Link
  2. ln Test Link
  3. ln / Link Test
  4. ln -h Link Test
Question 12 Multiple Choice (Single Answer)

What does the command umask 123 do?

  1. It sets file owner permissions to read and write
  2. It sets the permissions of other users to read
  3. It sets group permissions to read and execute
  4. All of them
Question 13 Multiple Choice (Single Answer)

User's with user id as 0 (Zero) are

  1. Printer users
  2. Not allowed to login using rlogin/ssh
  3. root users
  4. User id cannot be 0
Question 14 Multiple Choice (Single Answer)

User's passwords are generally stored in

  1. /etc/passwd
  2. /var/passwd
  3. /etc/password
  4. /var/password
Question 15 Multiple Choice (Single Answer)

What is the purpose of sync command?

  1. To synchronize user applications
  2. To synchronize keyboard and monitor
  3. To synchornize disk buffers
  4. To syschronize main memory and cache memory
Question 16 Multiple Choice (Single Answer)

How to mount a file system?

  1. fsck
  2. fsmount
  3. mount
  4. mountfs
Question 17 Multiple Choice (Single Answer)

"Count the number of errors in the statement if [password = password1] then echo password else password"

  1. 0
  2. 4
  3. 1
  4. 2
Question 18 Multiple Choice (Single Answer)

The valid conditional operator

  1. -NE
  2. -GT
  3. -LT
  4. -eq
Question 19 Multiple Choice (Single Answer)

The option not allowed in test command

  1. -d
  2. -l
  3. `-u
  4. -a
Question 20 True/False

linux allows more than one root directory

  1. True
  2. False