Unix/Linux Commands and Shell Programming

Test your knowledge of Unix/Linux command-line operations, shell scripting, file management, process control, and system administration commands.

19 Questions Published

Questions

Question 1 True/False

Windows provides more security and flexibility than Linux?

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

The most popular shell for unix till date is:

  1. Bourne
  2. Bash
  3. C shell
  4. Korn shell
Question 3 Multiple Choice (Multiple Answers)

Which of the following is/are text editors in Unix/Linux?

  1. Notepad
  2. Emacs
  3. Vi
  4. Notepad ++
Question 4 Multiple Choice (Single Answer)

What is the command to change the owner of a file?

  1. chmod
  2. tee
  3. chown
  4. chgrp
Question 5 Multiple Choice (Single Answer)

Which command lets you change back to the last working directory?

  1. cd -
  2. cd ~
  3. cd ..
  4. cd .
Question 6 Multiple Choice (Single Answer)

Which command should be used to give execute access to a file to everybody in the system?

  1. chmod u+c filename
  2. chmod g+x filename
  3. chmod og-rx filename
  4. chmod o+x filename
Question 7 Multiple Choice (Single Answer)

Which command is used to display the contents of a file named "TEST" in reverse order?

  1. cat -r TEST;
  2. tac TEST
  3. rev TEST
  4. cat -R TEST
Question 8 Multiple Choice (Single Answer)

The shortcut to suspend existing running jobs is:

  1. ctrl+a
  2. ctrl+z
  3. ctrl+c
  4. ctrl+s
Question 9 True/False

passwd command is owned by root and hence can be run by root only

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

An alternative to ls command

  1. dir
  2. list
  3. echo *
  4. cat
Question 11 Multiple Choice (Single Answer)

What will the following command do where foo and foo1 are both directories? rm ./foo ./foo/foo1

  1. Delete foo
  2. Delete foo and foo1
  3. Produce an error
  4. None of the above
Question 12 Multiple Choice (Single Answer)

How to display only hidden files in UNIX?

  1. ls -a
  2. ls -a|grep "^."
  3. ls -a|grep "^."
  4. ls -ltra
Question 13 Multiple Choice (Single Answer)

Which of the following commands is not a filter?

  1. man
  2. cat
  3. head
  4. pg
Question 14 Multiple Choice (Single Answer)

Command to kill the last background job?

  1. kill $!
  2. kill -9
  3. kill bg
  4. kill $*
Question 15 Multiple Choice (Single Answer)

Which command is used to create a new file system in unix?

  1. mkfs
  2. create fs
  3. format fs
  4. Not possible
Question 16 Multiple Choice (Single Answer)

Which of the following is not a shell variable?

  1. MAIL
  2. PATH
  3. TERM
  4. MESG
Question 17 Multiple Choice (Single Answer)

Which command kills all processes in your system except the login shell?

  1. kill 0
  2. kill -9
  3. kill 1
  4. kill $$
Question 18 Multiple Choice (Single Answer)

How many prompts are available in a UNIX system?

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

How do you find out the number of arguments passed to the shell script?

  1. $*
  2. $@
  3. $#
  4. $?