Linux Quizzes 2

 


1. How can the normal output of a command be written to a file while discarding the error output?

A. command > /dev/null 2&>1 output

B. command > 2 > discard-error > file

C. command > 2 > file & 1 > /dev/null

D. command > file 2 > /dev/null

Answer:D

2. Which of the following commands can be used to view a file and do search operations within it while viewing the contents?

A. grep

B. less

C. find

D. report

Answer: B

3. What is the first character for a file or directory names if they should not be displayed by commands such as ls unless specifically requested?

A. \ (backslash)

B. - (minus)

C. _ (underscore)

D. . (dot)

Answer: D

4. Which of the following are correct commands for changing the current directory to the user’s home ?

A. cd /home

B. cd ~

C. cd /

D. cd ..

Answer: B

5. Which of the following commands is used to lookup the current IP address of a system?

A. showip

B. ifconfig

C. ipconfig

D. less /proc/net/ipconfig

Answer: B

6. How can the current directory and its subdirectories be searched for the file name MyFile.xml?

A. grep -r MyFile.xml

B. find -name MyFile.xml

C. grep MyFile.xml | find

D. less MyFile.xml

Answer: B

7. Which of the following occurs for ln command?

A. A file is created that is a copy of an existing file

B. A file is moved from one location to another

C. A file is renamed

D. Points to an existing file is created by a file

Answer: D

8. Executable or binary files will be:

A. Device files

B. Regular files

C. Directory files

D. Special files

Answer: B

9. srwxr-xrw- is a

A. Internet file

B. Symbolic linked

C. Unix domain socket file

D. Shared file

Answer: C

On Linux which of the following is not a valid file type?

A. Socket

B. Inode

C. FIFO

D. Softlinked

Answer: B

Next Post Previous Post
No Comment
Add Comment
comment url