...

/

Listing Files and Directories

Listing Files and Directories

Learn how to list files and directories using the CLI.

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
Terminal 1
Terminal
Loading...

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

d

rwxr-xr-x

2

brian

brian

4096

Mar 2 11:59

Desktop

In the case of the Educative platform, User Owner and Group are ...