ls -l *.txt does not print the total
Hi:
Code:
$ ls -l Code:
$ ls -l *flac EDIT: du *wav does not solve the problem. I was looking in Google and saw this: Code:
ls -l files | awk '{ x += $5 } |
Try 'du -c *flac' or 'du -cBK *flac' if you want to specify kilobyte as the unit.
|
You are aware that the total is a measure of the number of blocks and not the actual size of items. As far as I can see on a quick search, the total line is only displayed
when used on a directory, ie. the total blocks used in that directory. allend's solution does seem to provide the same details though :) |
Globbing patterns like "*.flac" are expanded by the shell into a list of filenames before they are passed to the final command.
Code:
#when running... |
All I say is that ls could be smart enough to do it by itself. One of the things I dislike in this command is that, when issuing an 'ls foo' it lists not only file foo but the contents of directory foo if it exists. So, if you do 'ls foo*' you do not if you are seeing the foo* files or the contents of dir foo*. Because, on top of that, listings are not headed by the name of the directory as it would be logical. Thanks for the posts.
|
hmmm your ls must behave different to mine as far as:
Quote:
Code:
$ ls -l tmp* |
Mine is
ls (GNU coreutils) 6.9 Curiously enough, in a case like your example, it does not head up the list. |
Add the -d flag to ls if you don't want it to print directory contents
|
Well maybe it is the older version then as mine is:
ls (GNU coreutils) 8.5 |
Really, I have to have an alias that does the same thing as MS-DOS dir command: print directory name, total file size and number of files and directories. Some day I will have it.
|
All times are GMT -5. The time now is 10:56 PM. |