What is total in "ls -l" command ?


Recommended Posts

  nuka_t said:
the post right above yours was talking about ls -lh.

however, i just checked and ls -l is in kilobytes, not bytes. also, ls -l gives me 12,345 and ls -lh gives 11M

why does it round wrong like that?

You've got a file that's 12345kb? Sounds like you made that one up :whistle:

  Tek said:
Looks more like kilobytes to me.

I have several html files a few kb in size, and here is my output of ls -l

[mark@localhost 192.168.1.2]$ ls -l
total 92
-rw-rw-r--  1 mark mark 5638 Jun  5 12:42 DHCP.htm
-rw-rw-r--  1 mark mark 2997 Jun  5 12:42 DMZ.htm
-rw-rw-r--  1 mark mark 9646 Jun  5 12:42 Filters.htm
-rw-rw-r--  1 mark mark 3133 Jun  5 12:42 Help.htm
-rw-rw-r--  1 mark mark 7586 Jun  5 12:42 index.html
-rw-rw-r--  1 mark mark 3595 Jun  5 12:42 Log.htm
-rw-rw-r--  1 mark mark 3606 Jun  5 12:42 Passwd.htm
-rw-rw-r--  1 mark mark 3572 Jun  5 12:42 RouteDyna.htm
-rw-rw-r--  1 mark mark 5826 Jun  5 12:42 RouteStatic.htm
-rw-rw-r--  1 mark mark 7733 Jun  5 12:42 Security.htm
-rw-rw-r--  1 mark mark 5051 Jun  5 12:42 Status.htm
-rw-rw-r--  1 mark mark 7526 Jun  5 12:42 tmp.gif
-rw-rw-r--  1 mark mark 2051 Jun  5 12:42 Upgrade.htm
-rw-rw-r--  1 mark mark 7450 Jun  5 12:42 Wireless.htm

At least on my Fedora box, it is in bytes.

  nuka_t said:
i just made up a nubmer. what it really was was something like

73,333 rounding down to 72. ill try to post a screenie.

Actually it would be rounding up in that case. Since 73333MB/1024(MB/GB)=71.6GB

If you use --si, then it'll use 1000 instead of 1024.

  nuka_t said:
aaah, gotcha. thats what i thought it was, at first, but i wasnt sure.

Isn't switching between powers of 10 and 2 wonderful? :laugh:

This is why hard drive manufacturers suck, they stick to powers of 10 instead of powers of 2 like they should be :rolleyes:

  kjordan2001 said:
Isn't switching between powers of 10 and 2 wonderful?  :laugh:

This is why hard drive manufacturers suck, they stick to powers of 10 instead of powers of 2 like they should be  :rolleyes:

I know... They even added an --si option to the ls command to put it in "Drive Manufacturer Units" :rofl:

  markjensen said:
I have several html files a few kb in size, and here is my output of ls -l

[mark@localhost 192.168.1.2]$ ls -l
total 92
-rw-rw-r--  1 mark mark 5638 Jun  5 12:42 DHCP.htm
-rw-rw-r--  1 mark mark 2997 Jun  5 12:42 DMZ.htm
-rw-rw-r--  1 mark mark 9646 Jun  5 12:42 Filters.htm
-rw-rw-r--  1 mark mark 3133 Jun  5 12:42 Help.htm
-rw-rw-r--  1 mark mark 7586 Jun  5 12:42 index.html
-rw-rw-r--  1 mark mark 3595 Jun  5 12:42 Log.htm
-rw-rw-r--  1 mark mark 3606 Jun  5 12:42 Passwd.htm
-rw-rw-r--  1 mark mark 3572 Jun  5 12:42 RouteDyna.htm
-rw-rw-r--  1 mark mark 5826 Jun  5 12:42 RouteStatic.htm
-rw-rw-r--  1 mark mark 7733 Jun  5 12:42 Security.htm
-rw-rw-r--  1 mark mark 5051 Jun  5 12:42 Status.htm
-rw-rw-r--  1 mark mark 7526 Jun  5 12:42 tmp.gif
-rw-rw-r--  1 mark mark 2051 Jun  5 12:42 Upgrade.htm
-rw-rw-r--  1 mark mark 7450 Jun  5 12:42 Wireless.htm

At least on my Fedora box, it is in bytes.

In the CODE that you have given, I was asking what that total<92>, 92 was. I dont think that is in bytes.

I know that the fifth column which has <5638>, <2997> those are in bytes, but I wanted to know what is that 92 ???

  sunbiz_3000 said:
In the CODE that you have given, I was asking what that total<92>, 92 was. I dont think that is in bytes.

I know that the fifth column which has <5638>, <2997> those are in bytes, but I wanted to know what is that 92 ???

All of the numbers that I have posted have been about the total at the top not the fifth column. I don't think that some of the others understood your question.

In his example 92 stands for 92 kilobytes not bytes.

  fred666 said:
All of the numbers that I have posted have been about the total at the top not the fifth column. I don't think that some of the others understood your question.

In his example 92 stands for 92 kilobytes not bytes.

Oops! :blush:

You are exactly right, Fred. I was going off the individual file sizes. I guess a picture was literally worth 1000 words, as the output of the ls query helped make things clear what the original poster wanted.

  markjensen said:
Oops! :blush:

You are exactly right, Fred. I was going off the individual file sizes. I guess a picture was literally worth 1000 words, as the output of the ls query helped make things clear what the original poster wanted.

Oops for me too! :blush:

Although we had a few people asking questions on different parts of the output of ls.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.