meaning of columns in the result of executing 'ls -l'


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers meaning of columns in the result of executing 'ls -l'
# 1  
Old 09-22-2007
meaning of columns in the result of executing 'ls -l'

Hello all,

I do not understand the meaning of some columns in the result of executing 'ls -l'. For example, i got the following result by run 'ls -l'

total 3531


-rw-r--r-- 1 root root 1351680 Oct 17 20:50 fileindex.rpm
-rw-r--r-- 1 root root 16384 Oct 17 20:50 groupindex.rpm
-rw-r--r-- 1 root root 16384 Oct 17 20:50 nameindex.rpm
drw-r--r-- 2 root root 233 Oct 17 20:50 dirA


I do not know

(1) what does the 'total 3531' mean in the first line
(2) what is the meaning of the second column, i.e., containing the number 1, 1, 1, 2.
(3)What is the meaning of the fifth column for a directory, such as the number '233' for the directory 'dirA'.


thanks
# 2  
Old 09-22-2007
total 3531 --- total no.of block used in the directroy



Second column lists the number of hard links to that entry


When the size of the files in a directory are listed, the ls command
displays a total count of blocks, including indirect blocks.
# 3  
Old 09-22-2007
Quote:
Originally Posted by pbsrinivas
total 3531 --- total no.of block used in the directroy



Second column lists the number of hard links to that entry


When the size of the files in a directory are listed, the ls command
displays a total count of blocks, including indirect blocks.

pbsrinivas , thanks for your quick reply.

Do you mean the number '233' is the total number of blocks used by the directory 'dirA'.

How can i know/calculate the size in byte of a directory from the number of blocks used by the directory.
# 4  
Old 09-22-2007
du -k . will give u in KB..
# 5  
Old 09-22-2007
Quote:
Originally Posted by pbsrinivas
du -k . will give u in KB..
thanks again,

But, what on earth does the number '233' mean for the directory 'dirA'?
# 6  
Old 09-22-2007
In Unix it's the size allocated for the directory itself (the file meta-data).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare 2 columns from the same file and print a value depending on the result

Hello Unix gurus, I have a file with this format (example values): label1 1 0 label2 1 0 label3 0.4 0.6 label4 0.5 0.5 label5 0.1 0.9 label6 0.9 0.1 in which: column 1 is a row label column 2 and 3 are values I would like to do a simple operation on this table and get the... (8 Replies)
Discussion started by: ksennin
8 Replies

2. Shell Programming and Scripting

How to compare the current result with previous line result.?

Hi Gurus, I have requirement to compare current result with previous reuslt. The sample case is below. 1 job1 1 1 job2 2 1 job3 3 2 job_a1 1 2 job_a2 2 2 job_a3 3 3 job_b1 1 3 job_b2 2 for above sample file, GID is group ID, for input line, the job run... (1 Reply)
Discussion started by: ken6503
1 Replies

3. Shell Programming and Scripting

Executing the result of a program as a shell script

I have a program that returns a shell script and I want to execute the script. I'll use cat in my simple example, but wget is an example that is feasible. $ # First setup a script $ echo "ls > df" > simple $ # "cat simple" is now a program that returns a script $ cat simple ls df $ ... (3 Replies)
Discussion started by: kopite
3 Replies

4. Shell Programming and Scripting

sort, columns, no result! can I print files of "planes"?

hi, please can I ask you for some help? I have data from 3D situation, x y z value I'd like to use gnuplot to generate maps of the value in the planes z=0 to z=1 for example, my file looks like -0,012 0,0060 0,0 0,13972813076023477 -0,012 0,0064319163 4,2894483E-4 ... (1 Reply)
Discussion started by: kocour
1 Replies

5. Shell Programming and Scripting

prevent ssh from executing result in shell

Hi, I am writing a script on Solaris 10 and want to execute a remote ssh command. Normally this command should just return the value 0000000000002356 but when using ssh it seems it is passing the result to the shell to execute. ssh root@10.5.112.145 `/usr/bin/nawk -F\, '$1=="USG" && $2=="01"... (3 Replies)
Discussion started by: borderblaster
3 Replies

6. UNIX for Advanced & Expert Users

transporting scripts onto sloaris, executing it and returning the result to windows

Hi, I have to write a windows XP program, that would generate a Solaris Script, which would then be transported to Solaris, executed, the execution result then needs to be returned to the XP program. For transporting the file i was thinking of following FTP (admins rejected it) or File share on... (1 Reply)
Discussion started by: 00262881
1 Replies

7. UNIX for Dummies Questions & Answers

find common lines using just one column to compare and result with all columns

Hi. If we have this file A B C 7 8 9 1 2 10 and this other file A C D F 7 9 2 3 9 2 3 4 The result i´m looking for is intersection with A B C D F so the answer here will be (10 Replies)
Discussion started by: alcalina
10 Replies

8. UNIX for Dummies Questions & Answers

display the result of wc -l with words before and after the result

hello showrev -p | wc -l returns: 381 What to do in case I want to have this output: number of lines returned by showrev -p is: 381 thx (3 Replies)
Discussion started by: melanie_pfefer
3 Replies

9. Shell Programming and Scripting

Outputting formatted Result log file from old 30000 lines result log<help required>

Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in 1) starting with "20071126 11:11:11 Machine Header 1" 1000 lines... "End machine header 1" 2) starting with "20071126 12:12:12 Machine... (5 Replies)
Discussion started by: vikas.iet
5 Replies

10. UNIX for Advanced & Expert Users

executing script by cron doesnt give me expected result

Hi frnds... I m facing very irritating problem already waisted my 2 days.. I have a following script..( i am pasting only the main code) ftp -ivn 213.194.40.77 <<FTP user $user $password binary cd $FileDir/out lcd $localpath get $file rename $FileDir/out/$file $FileDir/tmp/$file... (1 Reply)
Discussion started by: clx
1 Replies
Login or Register to Ask a Question