Linux Commands and Shell Scripting

Quiz covering Linux/Unix command-line operations, shell scripting syntax, file systems, process management, and system administration fundamentals

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

I know linux can multitask -- how do I switch between programs?

  1. fg,bg, &
  2. switch
  3. fg,bg
  4. None
Question 2 Multiple Choice (Single Answer)

It is possible to redirect the output of a process to more than one source

  1. True
  2. False
  3. True but needs root permission
  4. None
Question 3 Multiple Choice (Single Answer)

Commands tar & dd

  1. dd allows block sizes to be defined, tar does not allow
  2. tar allow block sizes to be defined while dd does not allow
  3. both tar & dd allow block sizes to be modified
  4. both tar & dd do not allow block sizes to be modified
Question 4 Multiple Choice (Single Answer)

fdisk command is

  1. Used to create file systems
  2. Used to create harddisk partitions
  3. Used to create root file system alone
  4. None
Question 5 Multiple Choice (Single Answer)

The option not allowed in test command

  1. -d
  2. -l
  3. -u
  4. -a
Question 6 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 7 Multiple Choice (Single Answer)

Which of the following describes correctly the function of GhostScript?

  1. A free implementation of PostScript
  2. A printing management tool
  3. A program for converting files to PostScript
  4. A free interpreter of PostScript
Question 8 Multiple Choice (Single Answer)

Which one of the following lines is correctly formatted as the last line of a /etc/printcap file?

  1. :mx#2:
  2. :mx#2
  3. :mx#2\
  4. None
Question 9 True/False

vi is the only text editor available in linux

  1. True
  2. False
Question 10 Multiple Choice (Single Answer)

To search a string at the end of the line use

  1. / <str>*
  2. /<str>$
  3. /<str>&
  4. None
Question 11 Multiple Choice (Single Answer)

The right sequence shell command substitution & expansion

  1. {}, ~, $,($)
  2. {}, $, ~,($)
  3. {}, ~,$,($)
  4. None
Question 12 Multiple Choice (Single Answer)

The valid conditional operator

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

How to mount a file system?

  1. fsck
  2. fsmount
  3. mount
  4. mountfs
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)

Linux uses four basic file types

  1. executable, text, documents, directories
  2. directories, scripts, executables, normal files
  3. Normal files, special files, hidden files, device files
  4. ordinary files, directories, symbolic links, block and character device files
Question 16 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 17 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 18 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 19 Multiple Choice (Single Answer)

Who can manipulate the order of print jobs in a print queue?

  1. The owner of the job
  2. The root user
  3. Anyone
  4. Anyone who can submit jobs to the print queue
Question 20 True/False

tar can be used to write on to floppy disks

  1. True
  2. False