This is what I tried:
[demo@ ~]# ll /usr/local/apache2/logs/|xargs |du -hm - du: cannot access `-': No such file or directory
I want to see the amount of space each file occupies in
How to do it the correct way?
Are you trying not to descend into subdirectories?
Pipe to "sort -n" if desired.
Ok, not exactly what you asked for, but
The first command outputs the recursive directory tree showing also the file size in bytes, the second one is the same but has "human readable" output, showing the size in kilobytes, megabytes, gigabytes... whatever it considers appropriate for that file.