Which command will list the contents of a directory in long format?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The command that lists the contents of a directory in long format is "ls -l". This command is part of the GNU Core Utilities and provides a detailed view of the files and directories within the specified directory.

When executed, "ls -l" displays several columns of information for each file and directory, including the file permissions, the number of links, the owner name, the owner group, the size of the file in bytes, and the timestamp of the last modification. Importantly, this command also lists the files in a single column format, making it easy to read the additional information associated with each file or directory.

The other commands listed do not provide the same level of detail in their output. For example, "dir" is a command that is often used in DOS and Windows environments, and while it can list directory contents, it may not provide the long format with detailed information. The "ls -a" command shows all files, including hidden ones, but does not present the files in long format. Lastly, "stat" is a command that provides detailed status information on a specific file or directory, but it does not list the contents of a directory as a whole. Therefore, the use of "ls -l" is

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy