TestOut Linux Pro Practice Test

1 / 400

What command can you use to view the contents of the /etc/shells file?

cat

The command to view the contents of the /etc/shells file is commonly the 'cat' command. This command is used in Linux to concatenate and display the contents of files. When you execute `cat /etc/shells`, it will output the entire content of the file directly to the terminal, allowing you to see all the available login shells.

The other commands listed have specific uses that do not directly provide the full content in the same straightforward manner. For example, 'head' will only display the first few lines of the file, which might not give you the complete picture if you're looking for a particular entry at the end of the list. 'grep' is a powerful tool for searching text within files but requires additional parameters to filter the contents, so using it simply to "view" a file isn't its primary function. Finally, 'show' is not a standard Linux command and wouldn't work in this context, making it an invalid choice for viewing file contents.

Get further explanation with Examzify DeepDiveBeta

head

show

grep

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy