Top 150+ Solved Linux Programming MCQ Questions Answer
Q. The asterisk is a meta-character which in the command "ls *.txt" means
a. Any single character
b. Any combination of one or more characters
c. Any combination of zero or more characters
d. None of the above
Q. Which command runs the shell built-in command ‘command’ with the given argument?
a. builtin
b. caller
c. there is no command present for this purpose
d. none of the mentioned
Q. Which option of the command ‘cd’ use the actual filesystem path for cd..and the value ofpwd?
a. -l
b. -L
c. -p
d. -P
Q. Which command generates possible completions for string according to the and write it tostandard output?
a. compgen
b. complete
c. continue
d. none of the mentioned
Q. Which command executes ‘command’ in place of the current process instead of creating a new process?
a. exec
b. command
c. trap
d. none of the mentioned
Q. Assuming the files fileA, fileB, fileAB, fileBC and fileABC, exist in a directory, which files match with the pattern file[ABC]?
a. fileA, fileB and fileABC
b. fileABC
c. fileA and fileB
d. fileAB, fileBC and fileABC
Q. What will be printed for the command below?$ grep –c “^echo” abc
a. The count of lines that do not contain the pattern echo in file abc
b. The count of lines which begin with the pattern echo in file abc
c. The count of lines that ends with the pattern echo in file abc
d. None of the above
Q. Which one is used to select only one copy of the repeated lines?
a. uniq -u
b. uniq -d
c. uniq -c
d. uniq –I
Q. Indicate the right option to search for BOB, Bob, BOb or BoB?
a. grep –i Bob files
b. grep ‘B[oO][bB]’ files
c. grep ‘[BOB]’ files
d. grep -v ‘Bob’ files
Q. Indicate the right option to search for anything not a letter or number
a. grep ‘^[a-zA-Z0-9]’
b. grep ‘[^a-zA-Z0-9]’
c. grep ‘[a-zA-Z0-9]’
d. None of the above
Q. One of the entry of /etc/passwd file is shown below: user1:x:1111:2222:McqMate:/home/user1:/bin/bash Which among the following will print userid and home dir in the following pattern “user1:/home/user1”
a. awk `{print $1 “:” $6}` /etc/passwd
b. awk `{print $1 “:” $7}` /etc/passwd
c. awk `{print $2 “:” $6}` /etc/passwd
d. awk `{print $2 “:” $7}` /etc/passwd
Q. who cut –d ” ” -f1 what is the ouput if the who command displays like this user1 tty 0 1234
a. user1
b. user1 tty 0 1234
c. tty
d. tty 0 1234
Q. FIFO Stands For :
a. Figure in Figure Out
b. First in First Out
c. File input File Output
d. None
Q. The set of possible names for a given type of IPC is called its
a. Process
b. Name Space
c. Connect
d. Communication