See what is in a directory quickly and precisely with the `ls` command. 05.04.2026 | reading time: 2 min On the shell, `ls` is the first tool to reach for when he wants to know what lives in a directory; it lists entries quickly and can reveal hidden files, permissions, sizes, dates and more with options. Try it right now Run the following examples to see behavior: ``` $ ls file1.txt notes scripts $ ls -l -rw-r--r-- 1 user group 0 Jan 01 2024 file1.txt drwxr-xr-x 2 user group 4096 Jan 02 2024 scripts $ ls -a . .. .git file1.txt notes scripts ``` Flags that matter Use `-l` for a long listing with permissions and sizes, `-a` to include hidden entries, `-h` to humanize byte counts, `-t` to sort by modification time and `-r` to reverse order; combine them for scripts and quick inspection, for example `ls -alh` shows everything with readable sizes. How to use ls in pipelines Pipe `ls` into tools like `grep` or `sort` for quick filtering, but prefer `find` or `stat` for robust scripts where filenames contain newlines; `ls` is great for interactive checks and short pipelines, less ideal for machine-parsable output unless used with care. Next steps and certification Mastering `ls` is a small step toward confident filesystem work; continue exploring file permissions, `find`, and shell scripting to build real skills and consider formal certification like CompTIA Linux+ or LPIC-1 — bitsandbytes.academy offers intensive exam preparation to push his knowledge further. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities scripting troubleshooting storage