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.
Questions
Windows provides more security and flexibility than Linux?
- True
- False
The most popular shell for unix till date is:
- Bourne
- Bash
- C shell
- Korn shell
Which of the following is/are text editors in Unix/Linux?
- Notepad
- Emacs
- Vi
- Notepad ++
What is the command to change the owner of a file?
- chmod
- tee
- chown
- chgrp
Which command lets you change back to the last working directory?
- cd -
- cd ~
- cd ..
- cd .
Which command should be used to give execute access to a file to everybody in the system?
- chmod u+c filename
- chmod g+x filename
- chmod og-rx filename
- chmod o+x filename
Which command is used to display the contents of a file named "TEST" in reverse order?
- cat -r TEST;
- tac TEST
- rev TEST
- cat -R TEST
The shortcut to suspend existing running jobs is:
- ctrl+a
- ctrl+z
- ctrl+c
- ctrl+s
passwd command is owned by root and hence can be run by root only
- True
- False
An alternative to ls command
- dir
- list
- echo *
- cat
What will the following command do where foo and foo1 are both directories? rm ./foo ./foo/foo1
- Delete foo
- Delete foo and foo1
- Produce an error
- None of the above
How to display only hidden files in UNIX?
- ls -a
- ls -a|grep "^."
- ls -a|grep "^."
- ls -ltra
Which of the following commands is not a filter?
- man
- cat
- head
- pg
Command to kill the last background job?
- kill $!
- kill -9
- kill bg
- kill $*
Which command is used to create a new file system in unix?
- mkfs
- create fs
- format fs
- Not possible
Which of the following is not a shell variable?
- MAIL
- PATH
- TERM
- MESG
Which command kills all processes in your system except the login shell?
- kill 0
- kill -9
- kill 1
- kill $$
How many prompts are available in a UNIX system?
- 0
- 1
- 2
- 3
How do you find out the number of arguments passed to the shell script?
- $*
- $@
- $#
- $?