Determine the size of each file in a folder.
Hello,
i have a folder with 10 files and i would like to determine the size of each file. i was trying the command Code:
du -sh foldername Thank you . |
Remove the s from the arument list. The s argument means to give a summary report for the entire directory.
Code:
du -h directoryname Code:
man du |
yep, thanks i fould it .
but i would like to ask , how it is possible Not to see the last line ? i mean the last line display the total size which i dont want it . Thanks |
I'm curious... OP says he wants the sizes of 10 files in a given directory; when I run `du -h` I seem to be getting the sizes of all the directories within my current directory. Is that what OP wants?
Never mind above - I never gave it a directory name! :rolleyes: Well anyhow, here's a way to get rid of the last line of a list of lines: Code:
du -h | head -n-1 Code:
find . -maxdepth 1 -type f -printf "%-10s%f\n" |
Actually du is showing you the size of the final file / directory found, which in this case is the . directory, ie the directory you are in.
Why not play a little with globbing and what the files all contain within their names. |
Friends, i fill like been bombared with answers ! =)
Thank you very much . |
All times are GMT -5. The time now is 12:22 PM. |