cat Command MCQs – UNIX

1. To append an existing file, what symbol do we use?
(A). >
(B). <
(C). >>
(D). $
(E). None of these
Multiple Choice Question Answer: c
2. To display the non-printable characters, what option do we use with cat command?
(A). -v
(B). -n
(C). -x
(D). -a
(E). None of these
Multiple Choice Question Answer: a
3. cat *file*
the given command will display___
(A). all files in a directory
(B). all of the files with the filename will be containing the ‘file’
(C). will display no files
(D). a single file
(E). None of these
Multiple Choice Question Answer: b
4. For creating empty files, what command do we use?
(A). cp
(B). cat
(C). touch
(D). create
(E). None of these
Multiple Choice Question Answer: d
5. To display the contents of a file, what command do we use?
(A). cp
(B). rm
(C). cat
(D). mkdir
(E). None of these
Multiple Choice Question Answer: c
6. Apart from displaying the file contents, for what other files cat command is used?
(A). displaying
(B). deleting
(C). copying
(D). creating
(E). None of these
Multiple Choice Question Answer: d
7. Cat command can specify multiple arguments as filenames.
(A). True
(B). False
(C). Partially True
Multiple Choice Question Answer: a
8. To display the file with line numbers, what option do we use with cat command?
(A). -n
(B). -v
(C). -a
(D). -x
(E). None of these
Multiple Choice Question Answer: a
9. What the cat command can’t perform?
(A). displaying files
(B). creating files
(C). appending files
(D). deleting files
(E). None of these
Multiple Choice Question Answer: d
10. Which of the following that cat file01 file01 file01 will display?
(A). error
(B). blank terminal
(C). the contents of the given file01 are three times successively
(D). the contents of the file01 single time
(E). None of these
Multiple Choice Question Answer: c
11. What option do we use with the touch command that forces the command not to create the file, if it is not existing?
(A). -h
(B). -c
(C). -t
(D). -f
(E). None of these
Multiple Choice Question Answer: b
12. The incorrect command is_____
(A). cat file01
(B). cat > file01
(C). cat >> file1
(D). cat -a file01
(E). None of these
Multiple Choice Question Answer: d
13. What symbol do we use with cat command to create files?
(A). >
(B). <
(C). *
(D). /
(E). None of these
Multiple Choice Question Answer: a
14. What will happen if we create a file using the cat command with the same filename which is already existed in the current directory?
(A). existing file will be deleted
(B). new file is created separately
(C). existing file is overwritten
(D). an error will occur
(E). None of these
Multiple Choice Question Answer: c