Ad space (banner)
🖥️Linux Lessons
Lesson 4 / 61

Checking Contents with ls

ls is for when "I want to see what's inside this folder." ls stands for list, and it displays the files and folders inside a given directory.

ls alone shows the current directory's contents, and passing an argument like ls path lets you check a different directory instead.

Running ls lists the file and folder names in that folder, space-separated. Hidden files aren't shown in this default state.

A common early mistake is not realizing hidden files (ones starting with .) aren't shown, and mistakenly concluding "there's nothing here." Hidden files need the -a option.

In real work, this is used so often as the first thing you type in nearly every terminal session, just to check the situation before you start.

Linux
Try it (type this into the pseudo terminal)
ls

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)