What does ls -alh mean?

7,497

Solution 1

ls -alh is the same as ls -a -l -h.

Multiple short options can be combined like this.

Here are the meanings of those options from man ls:

-a, --all
    do not ignore entries starting with . 

-l
    use a long listing format 

-h, --human-readable
    with -l, print sizes in human readable format (e.g., 1K 234M 2G) 

Solution 2

-h stands for human readable.

As mentioned in the comment, you can combine arguments simply like: -alh. The order is irrelevant.

From man ls:

   -h, --human-readable
          with -l and/or -s, print human readable sizes (e.g., 1K 234M 2G)
Share:
7,497

Related videos on Youtube

Pichi Wuana
Author by

Pichi Wuana

Updated on September 18, 2022

Comments

  • Pichi Wuana
    Pichi Wuana over 1 year

    I have seen that people use ls -alh in the Linux terminal. However, when I see the manual, I don't see -alh (i.e. when I type man ls).

    Why do I not have it in the manual? Can someone explain what it does?

    • Kiran Ruth R
      Kiran Ruth R almost 8 years
      Personally, I prefer ls -lhA which is the same as -lha except that it excludes . and ...
  • Pichi Wuana
    Pichi Wuana almost 8 years
    Do you mean that ls -a -l -h is equal to ls -alh?
  • Jacob Vlijm
    Jacob Vlijm almost 8 years
    @PichiWuana exactly, you can combine arguments like that.
  • Pichi Wuana
    Pichi Wuana almost 8 years
    Why would I need human readable? I don't see any differences in the size of the font input...
  • Kusalananda
    Kusalananda almost 8 years
    @PichiWuana The size of the files and directories are printed in a human readable form, and not in bytes (which may be hard to parse if they are big numbers).
  • terdon
    terdon almost 8 years
    @PichiWuana human readable is not about the font size. It's about printing 1M instead of 1048576 when listing a file of one megabyte.
  • Pichi Wuana
    Pichi Wuana almost 8 years
    Ohhh.... I understand now.
  • SnakeDoc
    SnakeDoc almost 8 years
    In fairness, it's still "human readable" without the -h flag, although -h does make it easier ;)
  • Kevin
    Kevin almost 8 years
    Of course, I prefer to use ls -hal for HAL9000-readable.