Operating System - HP-UX
1833803 Members
2337 Online
110063 Solutions
New Discussion

Re: what's mean of total :,when i use ll command

 
SOLVED
Go to solution
常有慈悲心
Regular Advisor

what's mean of total :,when i use ll command

is it a total file size?
13 REPLIES 13
Steven E. Protter
Exalted Contributor

Re: what's mean of total :,when i use ll command

ll is just a file list. The total size is listed in bytes.

You may want to run whence ll

This will tell you whether you have a binary ll or not. On older systems we used to create an alias command so that when the usr ran ll ls -la or some other variation actually executed.

Simple answer: Yes. total file size in bytes.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Eric Antunes
Honored Contributor

Re: what's mean of total :,when i use ll command

Hi,

Total is the total number of files of the directory (files . and .. are hiden with ll command)

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor
Solution

Re: what's mean of total :,when i use ll command

Sorry,

Total is the total space occupied by files of the directory (files . and .. are hiden with ll command)
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: what's mean of total :,when i use ll command

SEP,

Noe I'm confused since I get 19Gb for a directory (TST) with:

#du -k TST
19163064 TST

And something close to the double with ll:

#ll TST|more
total 38326120

What is your interpretation of this results?
Each and every day is a good day to learn.
Peter Godron
Honored Contributor

Re: what's mean of total :,when i use ll command

Eric,
du -k is in Kb
ll reports in blocks of 512 bytes
Regards
MarkSyder
Honored Contributor

Re: what's mean of total :,when i use ll command

From the du man page:

-k Gives the block count in 1024-byte blocks

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Eric Antunes
Honored Contributor

Re: what's mean of total :,when i use ll command

Thanks Peter. I use always "du" to query directory sizes and that's why I didn't understand "ll" output either...
Each and every day is a good day to learn.
Peter Godron
Honored Contributor

Re: what's mean of total :,when i use ll command

Hi,
the answer from man is:
"The first entry printed is the total number of blocks in the directory" @ 512 bytes/block
You can check this by using "ls -ls"
The total number is the sum of the entries in column 1.
Regards
MarkSyder
Honored Contributor

Re: what's mean of total :,when i use ll command

Peter's latest answer explains why du gives an answer double that of ll: du uses 1024 byte blocks and ll uses 512 byte blocks.

It's not even my thread and I've learnt from it!

Mark
The triumph of evil requires only that good men do nothing
Ralph Grothe
Honored Contributor

Re: what's mean of total :,when i use ll command

So far I have thought that the totals figure shown is the number of occupied blocks,
but of course in units of the blocksize of your filesystem.

On HP-UX an
e.g.


# fstyp -v $(bdf /|awk 'NR>1{print$1}')
vxfs
version: 3
f_bsize: 8192
f_frsize: 1024
f_blocks: 311296
f_bfree: 252742
f_bavail: 236946
f_files: 67728
f_ffree: 63184
f_favail: 63184
f_fsid: 1073741827
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 0
f_fsindex: 6
f_size: 311296


would show, but I could be wrong
Madness, thy name is system administration
Ranjith_5
Honored Contributor

Re: what's mean of total :,when i use ll command

Hi,

First line of the output of ll command shows total number of blocks used or that directory.

The command 'll' with the flag '-s' will give you a ore detailed view. The -s flag gives the block size of the individual usage.

See man page ll.

regards,
Syam
Eric Antunes
Honored Contributor

Re: what's mean of total :,when i use ll command

Peter,

My "man ll" gives me this:

"man ll

ls(1) ls(1)

NAME
ls, lc, l, ll, lsf, lsr, lsx - list contents of directories

SYNOPSIS
ls [-abcdefgilmnopqrstuxACFLR1] [names]

lc [-abcdefgilmnopqrstuxACFLR1] [names]

l [ls_options] [names]
ll [ls_options] [names]
lsf [ls_options] [names]
lsr [ls_options] [names]
lsx [ls_options] [names]

DESCRIPTION
For each directory argument, the ls command lists the contents of the
directory. For each file argument, ls repeats its name and any other
information requested. The output is sorted in ascending collation
order by default (see Environment Variables below). When no argument
is given, the current directory is listed. When several arguments are
given, the arguments are first sorted appropriately, but file
arguments appear before directories and their contents.

...

"

No info. about those 512bytes...
Each and every day is a good day to learn.
Geoff Wild
Honored Contributor

Re: what's mean of total :,when i use ll command

It is under the -s:

-s List size in blocks, including indirect blocks, for each
entry. The first entry listed is the total number of blocks
in the directory. When used in multicolumn output, the
number of blocks precedes the file name in each column. The
number of indirect blocks in a file is filesystem dependent.


If you do a ll -s, it will print the individual blocks for each file:

# ll -s
total 11800
2 -rw-r--r-- 1 root sys 168 Jan 15 14:08 OLDsyslog.log
11734 -r--r--r-- 1 root root 6007049 Jan 19 06:06 mail.log
0 -rw-r--r-- 1 root sys 0 Nov 6 2002 swlist
64 -rw-r--r-- 1 root root 24243 Jan 19 04:44 syslog.log


Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.