# The Linux ls command

Inside a folder you can list all the files that the folder contains using the `ls` command:

```bash
ls
```

If you add a folder name or path, it will print that folder's contents:

```bash
ls /bin
```

<img src="https://www.freecodecamp.org/news/content/images/2020/10/Screenshot-2019-02-09-at-18.50.14.png" alt="Screenshot-2019-02-09-at-18.50.14" height="425" width="1289">

`ls` accepts a lot of options. One of my favorite combinations is `-al`. Try it:

```bash
ls -al /bin
```

<img src="https://www.freecodecamp.org/news/content/images/2020/10/Screenshot-2019-02-09-at-18.49.52.png" alt="Screenshot-2019-02-09-at-18.49.52" height="777" width="1289">

Compared to the plain `ls` command, this returns much more information.

You have, from left to right:

* the file permissions (and if your system supports ACLs, you get an ACL flag as well)
* the number of links to that file
* the owner of the file
* the group of the file
* the file size in bytes
* the file's last modified datetime
* the file name

This set of data is generated by the `l` option. The `a` option instead also shows the hidden files.

Hidden files are files that start with a dot (`.`).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kgk.gitbook.io/resources/resources/linux/commands/the-linux-ls-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
