It is currently Tue, 17 May 2022 18:10:55 GMT



 
Author Message
 Ls quick question
Just a quick question on ls...when you run the command, the first line
of the output is of the form total 12 ( the number was chosen randomly).
Could you please tell me what 12 is referring to? Is it the total number
of files in the directory or it has to do with the files' sizes?
I look forward to hearing from you soon.
Thanks in advance.


 Wed, 04 Jun 2003 00:58:30 GMT   
 Ls quick question

Experiment a bit to found out.

try this:

mkdir junk
cd junk
touch a b c d e f g
ls -l

How many files are there?
What are there sizes?
What is the value of total?

Tristan.



 Wed, 04 Jun 2003 01:14:21 GMT   
 Ls quick question
Hi Tristan,
Thanks very much for your reply. I run the script and when all files had no
size, the total was zero itself. However, when I brought up vi and I typed
some stuff in a the size of file a went up to 22, while total went up to 2. It
has to do with the size of files then, but how is it related to it?

George



 Wed, 04 Jun 2003 01:30:14 GMT   
 Ls quick question
It was: Fri, 15 Dec 2000 17:30:14 +0000  and with STARTLING insight,
"Lekeas GK <G.K.Lek...@city.ac.uk>"
  posted "Re: Ls quick question"
 to "comp.unix.shell" :

-->Hi Tristan,
-->Thanks very much for your reply. I run the script and when all files had no
-->size, the total was zero itself. However, when I brought up vi and I typed
-->some stuff in a the size of file a went up to 22, while total went up to 2. It
-->has to do with the size of files then, but how is it related to it?
-->
-->George
-->
-->
-->> >
-->> > Just a quick question on ls...when you run the command, the first line
-->> > of the output is of the form total 12 ( the number was chosen randomly).
-->> > Could you please tell me what 12 is referring to? Is it the total number
-->> > of files in the directory or it has to do with the files' sizes?
-->> > I look forward to hearing from you soon.
-->> > Thanks in advance.
-->>
-->> Experiment a bit to found out.
-->>
-->> try this:
-->>
-->> mkdir junk
-->> cd junk
-->> touch a b c d e f g
-->> ls -l
-->>
-->> How many files are there?
-->> What are there sizes?
-->> What is the value of total?
-->>
-->> Tristan.
-->

Don't qoute me on this, but I think it's counting the total of the inodes
used by files in the directory, at least on ext2 fs.
/ts

              tenox  @  home  dot   com



 Wed, 04 Jun 2003 02:09:35 GMT   
 Ls quick question
It was: Fri, 15 Dec 2000 17:30:14 +0000  and with STARTLING insight,
"Lekeas GK <G.K.Lek...@city.ac.uk>"
  posted "Re: Ls quick question"
 to "comp.unix.shell" :

-->Hi Tristan,
-->Thanks very much for your reply. I run the script and when all files had no
-->size, the total was zero itself. However, when I brought up vi and I typed
-->some stuff in a the size of file a went up to 22, while total went up to 2. It
-->has to do with the size of files then, but how is it related to it?
-->
-->George
-->
-->
-->> >
-->> > Just a quick question on ls...when you run the command, the first line
-->> > of the output is of the form total 12 ( the number was chosen randomly).
-->> > Could you please tell me what 12 is referring to? Is it the total number
-->> > of files in the directory or it has to do with the files' sizes?
-->> > I look forward to hearing from you soon.
-->> > Thanks in advance.
-->>
-->> Experiment a bit to found out.
-->>
-->> try this:
-->>
-->> mkdir junk
-->> cd junk
-->> touch a b c d e f g
-->> ls -l
-->>
-->> How many files are there?
-->> What are there sizes?
-->> What is the value of total?
-->>
-->> Tristan.
-->

Don't qoute me on this, but I think it's counting the total of the inodes
used by files in the directory, at least on ext2 fs.
/ts

              tenox  @  home  dot   com



 Wed, 04 Jun 2003 02:10:07 GMT   
 Ls quick question
Hi,

    as is CONSTANTLY advised in this newsgroup (and others): "read the
man page!" If that fails, read it again, because you probably missed it
the 1st time. Here is the answer from my HPUX man page for ls:

When an option is specified that results in a listing of directory
and/or file sizes in bytes or blocks (such as the -s or -l (ell)
option), a total count of blocks, including indirect blocks, is also
printed at the beginning of the listing.

So, there is the answer "a total count of blocks..."

Kevin

In article <3A3A4DB6.B8338...@city.ac.uk>,
  Lekeas GK <G.K.Lek...@city.ac.uk> wrote:

Sent via Deja.com
http://www.deja.com/



 Wed, 04 Jun 2003 02:51:57 GMT   
 Ls quick question

always read the man page before asking questions; they're amazingly
informative.

man ls
  When the size of the files in a directory are listed, a total count
  of blocks, including indirect blocks, excluding holes, is prinyed.



 Wed, 04 Jun 2003 02:57:50 GMT   
 Ls quick question
Lekeas GK <G.K.Lek...@city.ac.uk> a crit dans le message :
3A3A4DB6.B8338...@city.ac.uk...

12 is the number of blocks used by the files. Traditionally, blocks were 512
bytes but recent systems tend to use 1024 bytes blocks.

$ ls -ls tmp
total 72
   0 -rw-rw-r--   1 cl       cl              0 Dec 16 14:43 titi
  72 -rw-r--r--   1 cl       cl          72460 Dec 16 14:43 toto



 Wed, 04 Jun 2003 21:46:12 GMT   
 
   [ 8 post ] 

Similar Threads

1. quick little question: ls results to a file

2. I have a Quick Question, need quick answer.

3. /usr/bin/ls /usr/ucb/ls /usr/local/bin/ls

4. Quick money - quick.mon [01/01]

5. Quick Grub Question

6. Quick sendmail question...

7. Quick question regarding Solaris 9

8. steps for changing modules.conf .. quick question

9. Very quick telnet question

10. Quick question regarding 'includes'


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software