ls
What is ls?
ls: List — List files and directories in the current folder. ls lists the files and folders in a directory. ls -l shows details like permissions, owner, size and date, ls -a includes hidden files, and ls -lh shows sizes in a readable form such as 4.2M. Combined options are common: ls -lah gives everything at once. ls -lt sorts by modification time, which quickly shows the newest log or upload.
Frequently asked questions about ls
What should you keep in mind with ls?
The permission column, such as -rw-r--r--, tells you who can read, write or execute a file, which helps when an application cannot write to a folder. For deep folder structures, tree shows the hierarchy, and du -sh * shows which folders take up the most space. These are the first commands to run when you log into an unfamiliar server.
At a glance
| Category | CLI commands |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |