![Forrest logo](/images/logo.png)
ls:tldr:79e2f
ls: Long format list with size displayed using human-readable units (KiB, MiB, GiB).
$ ls -lh
try on your machine
The ls -lh
command is used in Unix-based systems to list the files and directories in the current directory (by default) in a human-readable format.
Here's a breakdown of the options used in this command:
ls
stands for "list" and is a command used to list files and directories.-l
(long format) is an option that specifies the output format to be in a detailed, vertical list view. It provides additional information such as permissions, owner, size, creation date, and more for each file or directory.-h
(human-readable) is an option that makes the output sizes more easily understandable by human readers. It converts the sizes of files and directories from bytes to a larger unit, such as kilobytes (KB), megabytes (MB), or gigabytes (GB), based on their magnitude.
When you combine the -l
and -h
options with the ls
command, you get a detailed list view of files and directories with human-readable sizes.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.