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)
Related videos on Youtube
Author by
Pichi Wuana
Updated on September 18, 2022Comments
-
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 typeman ls
).Why do I not have it in the manual? Can someone explain what it does?
-
Kiran Ruth R almost 8 yearsPersonally, I prefer
ls -lhA
which is the same as-lha
except that it excludes.
and..
.
-
-
Pichi Wuana almost 8 yearsDo you mean that
ls -a -l -h
is equal tols -alh
? -
Jacob Vlijm almost 8 years@PichiWuana exactly, you can combine arguments like that.
-
Pichi Wuana almost 8 yearsWhy would I need human readable? I don't see any differences in the size of the font input...
-
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 almost 8 years@PichiWuana human readable is not about the font size. It's about printing
1M
instead of1048576
when listing a file of one megabyte. -
Pichi Wuana almost 8 yearsOhhh.... I understand now.
-
SnakeDoc almost 8 yearsIn fairness, it's still "human readable" without the
-h
flag, although-h
does make it easier ;) -
Kevin almost 8 yearsOf course, I prefer to use
ls -hal
for HAL9000-readable.