Unix/Linux Shell Scripting and Commands
Test your knowledge of Unix/Linux shell commands, special variables, file permissions, and shell scripting fundamentals.
Questions
Command to verify the current working directory.
- cwd
- pwd
- wd
- None of the above
Which of the below are wild card charaters
- *
- ?
- #
- $
Command to verify the disk usage
- df
- du
- quota
- ulimit
Which command is used to run a job in the background
- bg
- &
- nohup
- fg
How to verify the flavor of the UNIX system that you are using
- uname
- fname
- SHELL
- ulimit
How to verify the shell of the UNIX system that you are using
- uname
- fname
- SHELL
- ulimit
Command to check for a pattern in a file
- find
- grep
- pattern
- check
Command to go to home directory without using absolute path
- cd .
- Cd ..
- cd -
- cd ~
Command to copy a file without changing the creation time
- cp -r
- cp
- cp -p
- cp -R
Command to invert the selection in grep
- grep -i
- grep -v
- grep -p
- None of the above
Command to remove the directories and also its sub directories.
- rm -f
- rm -r
- rm -R
- rm -F
Command to provide all access for user, read and execute access for the groups and Read access alone for the others.
- chmod 756
- chmod 457
- chmod 675
- chmod 754
Command to verify the previous command execution status
- $$
- $?
- $!
- $#
Command to verify the number of arguments passed
- $$
- $?
- $!
- $#
Command to retrieve the Process ID of current process
- $$
- $?
- $!
- $#
Command to retrieve the recently initiated job's process ID
- $$
- $?
- $!
- $#
What does it mean ${parameter:-5}
- If parameter exists and isn't null, return its value; otherwise return 5
- If parameter exists and isn't null, return its value; otherwise set it to 5 and then return it
- If parameter exists and isn't null, return 5; otherwise return null.
- None of the above
How to set NULL value to a variable
- name=
- name=''
- name=""
- all of the above
Which one of the below checks for the pattern match as x, xx, xxx, ...
- *(X)
- ?(X)
- +(X)
- !(X)
Command to verify whether a string is null.
- -n
- -z
- -s
- None of the above