LEARN THE LS COMMAND IN UNDER 1 MINUTE #linux #shorts

Published: December 1, 2025 (Updated: Dec 1, 2025)

Enjoying this content? Subscribe to the Channel!

Linux File Navigation Made Easy: Mastering the Essential ls Command and Its Powerful Options


Welcome to Darren’s Linux Toolbox!

Every journey through the Linux command line starts with a single, foundational tool: the ls command. While seemingly simple, mastering ls is non-negotiable for efficient file navigation, directory management, and system diagnosis. It is the command you will use a thousand times a day.

At its core, ls (short for “list”) displays the files and subdirectories within a specified location. But the real power comes when we start adding arguments and options that reveal vital information about permissions, ownership, hidden files, and modification times.

Ready to move beyond the basic directory listing? Let’s dive deep into the essential options that will turn you into an ls expert.


The Basics: What Does ls Do?

When executed without any options or arguments, the ls command lists the files and directories in your current working directory.

Command:

ls

Result:

You will see a simple, clean list of all non-hidden files and directories located where you currently are in the terminal.


Deep Dive: Understanding the Long Format Listing (-l)

One of the most frequently used options is the long format listing, invoked using the -l flag. This flag transforms a simple list into a powerful data table, providing deep insight into every file.

Command:

ls -l

What you get with -l:

The long format listing provides comprehensive details, including:

  1. File Permissions: Who can read, write, or execute the file.
  2. Number of Links: How many hard links point to this file.
  3. Owner: The user who owns the file.
  4. Group: The group that owns the file.
  5. Size: The size of the file in bytes (by default).
  6. Modification Time: The date and time the file was last changed.
  7. File Name: The name of the file or directory.

Unmasking the Hidden: Showing All Files (-a)

In Linux, many critical configuration files are intentionally kept out of sight by convention—they begin with a dot (.). These are known as “hidden files.” If you need to troubleshoot system settings or access application configuration files, you need to call them out specifically.

The -a (all) option forces ls to display every entry, including those pesky hidden files and the directory pointers (. for the current directory and .. for the parent directory).

Command:

ls -a

Pro Tip: Combining Options

This is where the flexibility of the Linux command line shines. You can combine multiple short options together. For instance, if you want the comprehensive details of the long format and all the hidden files, you would combine the options like this:

ls -la

Readability Matters: File Sizes for Humans (-h)

When looking at the long listing (-l), the file sizes are listed in raw bytes, which can be hard to interpret quickly (is 409600 bytes big or small?). The -h (human-readable) option solves this problem instantly by displaying file sizes in easily digestible units like Kilobytes (K), Megabytes (M), or Gigabytes (G).

Note: The -h option is almost always used in conjunction with the -l option, as it is only useful when file size data is already being displayed.

Command:

ls -lh

Example Comparison:

Option Size Display Meaning
ls -l 1048576 1 Megabyte (Raw Bytes)
ls -lh 1.0M 1 Megabyte (Human Readable)

Target Practice: Listing Specific Directories

So far, we have only listed the files in the current location. However, ls allows you to specify any path as an argument. This is essential for inspecting other parts of the system without having to navigate away from your current working directory.

If you want to view the files within the system’s /etc configuration directory, you simply pass that path as the argument:

Command:

ls /etc

And of course, you can apply all the powerful flags we’ve learned to a specific directory as well:

ls -lha /etc

This command lists all files in the /etc directory, in a long format, showing hidden files, with sizes displayed in human-readable units.


Conclusion: Take Command of Your Terminal!

The ls command is much more than just a simple file list—it is a powerful tool for gathering detailed intelligence about your filesystem. By mastering the core options like -l, -a, and -h, you gain complete control and visibility, which is the cornerstone of effective Linux usage.

Ready to put these skills into practice? Open your terminal right now and start combining these flags to see the detailed structure of your system!

If you found this breakdown helpful and you’re hungry for more clear, accessible tech tutorials, don’t forget to like this post and subscribe to Darren’s Tech Tutorials on YouTube! Your support helps us keep bringing you the essential knowledge you need to master technology. Happy commanding!