What does the -lh option do in the ls command?

0269

The -lh option in the ls command is used to display files and directories in a long format with human-readable file sizes.

  • -l: This option provides a detailed listing, including file permissions, number of links, owner, group, size, and timestamp.
  • -h: This option makes the file sizes easier to read by converting them into a more understandable format (e.g., KB, MB).

For example, running ls -lh will show output like this:

-rw-r--r-- 1 user group 1.5K Jan 01 12:00 example.txt

Here, 1.5K indicates the size of the file in kilobytes.

0 Comments

no data
Be the first to share your comment!