# ls

> A command that lists what is in a folder. It shows files and folders.

**Field:** Infrastructure  
**Category:** Linux & the Command Line  
**Also known as:** ls Command, List Files, ls -la

## Think of it like

Think of it like a peek in a box to see what is in it.

## Definition

The ls command lists the files and folders in a folder. With no extra words, it lists the folder you are in. Adding -l shows more about each file, like its size, owner and rights. Adding -a also shows hidden files. You can give it a path to look in another folder.

## Example

Emma types ls -l in her web folder. She sees index.html, who owns it and when it last changed.

## Example code

```console
$ ls
notes.txt  photos
$ ls -a
.  ..  .bashrc  .ssh  notes.txt  photos
```

Plain ls hides files that start with a dot. Adding -a shows them too.

## Why it matters

It is the command you will type most. You use it to see what is there before you change anything.

## Common mistake

Thinking a file is missing because ls does not show it. It may be hidden, so try ls -a.

## Three principles

- **What is here.** Lists the current folder.
- **-l for detail.** Size, owner and rights.
- **-a for hidden.** Shows dot files too.

## Related terms

- [cd](https://learn.benibix.com/term/infrastructure/cd-command)
- [pwd](https://learn.benibix.com/term/infrastructure/pwd-command)
- [Hidden File (Dotfile)](https://learn.benibix.com/term/infrastructure/hidden-file)
- [File Permissions](https://learn.benibix.com/term/infrastructure/file-permissions)
- [Command Line](https://learn.benibix.com/term/infrastructure/command-line)

## Taught in

- [The Linux File Tree](https://learn.benibix.com/learn/infrastructure-linux/linux-file-tree): Linux CLI, 4/10

![A folder tree with a single slash at the top, the root. Below it hang etc, home, root and var. Under home sits emma, marked with a tilde as her home folder and with a you-are-here marker. Inside emma are notes.txt, photos and two faded hidden items, .bashrc and .ssh. Under var sits log. An arrow shows a cd move from emma down to var/log.](https://learn.benibix.com/diagrams/inf3-file-tree.svg)

---

Source: https://learn.benibix.com/term/infrastructure/ls-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
