Unix/Lunux MCQ Quiz Hub

Linux Mcqs Questions Set 4

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

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





✅ Correct Answer: 3

The /etc/passwd file doesn’t contain





✅ Correct Answer: 2

User id 0 is





✅ Correct Answer: 2

The login shell is





✅ Correct Answer: 1

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

By default, a Linux user falls under which group?





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2

which of these is NOT a valid variable in bash





✅ Correct Answer: 4

The expression expr -9 % 2 evaluates to:





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 3

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





✅ Correct Answer: 1

While executing a command, the shell





✅ Correct Answer: 2

Which variable contains current shell process id





✅ Correct Answer: 3

Which command is used to debug a shell script program





✅ Correct Answer: 2

For every successful login, which script will be executed?





✅ Correct Answer: 2

Hidden files are





✅ Correct Answer: 3

Shell is ?





✅ Correct Answer: 1

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





✅ Correct Answer: 3

Which of the following is true?





✅ Correct Answer: 3

Which is true with regards to the shell prompt





✅ Correct Answer: 3

What is a shell in UNIX?





✅ Correct Answer: 1

Which of the following represents an absolute path?





✅ Correct Answer: 4

BASH shell stands for?





✅ Correct Answer: 1

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





✅ Correct Answer: 3

The redirection 2> abc implies





✅ Correct Answer: 3

cmd 2>&1 > abc will





✅ Correct Answer: 4

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





✅ Correct Answer: 2

Syntax to suppress the display of command error to monitor?





✅ Correct Answer: 4

cat < file1 >> file2 | file3





✅ Correct Answer: 4

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





✅ Correct Answer: 2

The $ variables in a shell script context designates





✅ Correct Answer: 3

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





✅ Correct Answer: 2

Which variable contains last background job process id





✅ Correct Answer: 4

Which command can be used to test various file attributes





✅ Correct Answer: 3

* Specifies





✅ Correct Answer: 2

? Specifies





✅ Correct Answer: 3

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

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





✅ Correct Answer: 3

Which variable will display the list of the positional parameters?





✅ Correct Answer: 2

Which option of grep displays the line number as well?





✅ Correct Answer: 3

How can you search for blank line in a file?





✅ Correct Answer: 2

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





✅ Correct Answer: 3

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





✅ Correct Answer: 2

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





✅ Correct Answer: 1

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





✅ Correct Answer: 2