cat Command MCQs – UNIX

By: Prof. Fazal Rehman Shamil

Solved MCQs on Displaying and Creating Files: cat Command in UNIX.

To append an existing file, what symbol do we use?
(A). >
(B). <
(C). >>
(D). $
(E). None of these
Multiple Choice Question Answer: c


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


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


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


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


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


Cat command can specify multiple arguments as filenames.
(A). True
(B). False
(C). Partially True
Multiple Choice Question Answer: a


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


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


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


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


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


What symbol do we use with cat command to create files?
(A). >
(B). <
(C). *
(D). /
(E). None of these
Multiple Choice Question Answer: a


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

Prof. Fazal Rehman Shamil