Listing Files and Directories
Explore how to use the ls command to list files and directories in a command-line interface. Understand how to interpret detailed outputs including file types, permissions, ownership, sizes in human-readable formats, and how to reveal hidden files to navigate the filesystem efficiently.
We'll cover the following...
The ls command
The ls command shows us the contents of a directory. By default, it only shows part of the story. We can get a more descriptive listing by passing some additional arguments to the command. Let’s run the terminal to execute the command ls -l in our home directory. (That’s a lowercase L.)
$ ls -l
This gives us a long listing of the current directory’s contents. The file names are all the way on the right side, preceded by some additional information. How it breaks down is shown in the figure below.
Directory Contents
Type | Permissions | Links | User owner | Group | Size | Date modified | Filename |
|
|
|
|
|
|
|
|
In the case of the Educative platform,
User OwnerandGroupare root users.
The first character tells us the type of entry. A d ...