When are file sizes shown in KB (K)?

File sizes are shown in kilobytes (KB) when you use the -h option with the ls command, and the file size is between 1 KB and 1 MB.

Example:

When you run:

ls -lh

The output might look like this:

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

In this case, 1.5K indicates that the file size is 1.5 kilobytes.

Summary:

  • 1 KB to 1 MB: Sizes in this range will be displayed in KB.
  • Less than 1 KB: Sizes will be shown in bytes.
  • 1 MB to 1 GB: Sizes will be displayed in MB.
  • Greater than 1 GB: Sizes will be shown in GB.

If you have more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!