Unix/Lunux MCQ Quiz Hub

Linux Mcqs Questions Set 4

Choose a topic to test your knowledge and improve your Unix/Lunux skills

1. Which of the following identifiers associated with a process decide its privilege level




2. The /etc/passwd file doesn’t contain




3. User id 0 is




4. The login shell is




5. Which of the following command can be used to change the user password?




6. What does the following command do ? who | wc –l




7. By default, a Linux user falls under which group?




8. Which of the following files need to be referred for users secondary group?




9. How do you print the lines between 5 and 10, both inclusive




10. Create a new file new.txt that is a concatenation of file1.txt and file2.txt




11. which of these is NOT a valid variable in bash




12. The expression expr -9 % 2 evaluates to:




13. The statement z = expr 5 / 2 would store which of the following values in z?




14. To feed standard output of one command to standard input of another in a single shell session




15. Which of the following commands allows definition and assignment of environment variables under bash




16. While executing a command, the shell




17. Which variable contains current shell process id




18. Which command is used to debug a shell script program




19. For every successful login, which script will be executed?




20. Hidden files are




21. Shell is ?




22. If a file with execute permissions set, but with unknown file format is executed




23. Which of the following is true?




24. Which is true with regards to the shell prompt




25. What is a shell in UNIX?




26. Which of the following represents an absolute path?




27. BASH shell stands for?




28. Which of the following files will not be displayed by the command cat re* ?




29. The redirection 2> abc implies




30. cmd 2>&1 > abc will




31. Which of these is the correct method for appending “foo” in /tmp/bar file?




32. Syntax to suppress the display of command error to monitor?




33. cat < file1 >> file2 | file3




34. Executing cat /etc/password > /dev/sda as superuser will




35. The $ variables in a shell script context designates




36. Which variable is used to display number of arguments specified in command line




37. Which variable contains last background job process id




38. Which command can be used to test various file attributes




39. * Specifies




40. ? Specifies




41. Which of the following file set in the current directory are identified by the regular expression a?b*




42. What command would send the output of cmd1 to the input of cmd2?




43. What is the output of the following command for bash shell: echo linux $0




44. Which variable will display the list of the positional parameters?




45. Which option of grep displays the line number as well?




46. How can you search for blank line in a file?




47. Assuming the files fileA, fileB, fileAB, fileBC and fileABC, exist in a directory, which files match with the pattern file[ABC]?




48. What will be printed for the command below? $ grep –c “^echo” abc




49. Which one is used to select only one copy of the repeated lines?




50. Indicate the right option to search for BOB, Bob, BOb or BoB?