I mounted an apple time capsule in /etc/fstab as cifs type to /media/time_capsule. I now want to look at directory file sizes to help me clean out the drive. I usually use the command below to list human readable sizes for files and directories: Code: ls -lh but all the directories show up with 0 size! Not sure why / how to let me view directory size in terminal with ls. Update an index? thanks.
ls -lh
Try some of these commands while in /media/time_capsule: df -h or du -hs *
Find files and sort by file size: Code: find /media/time_capsule -depth -type f -exec stat -c "%s %n" {} \;|sort -rn|more Find directories and sort by disk usage: Code: du /media/time_capsule|sort -rn|more
find /media/time_capsule -depth -type f -exec stat -c "%s %n" {} \;|sort -rn|more
du /media/time_capsule|sort -rn|more
Last edited by prodigy_; February 24th, 2013 at 05:27 PM.
du and find with sort works great, thanks. I still don't understand why ls -l does this fir local directories and not for my mount.
This depends on the cifs implementation on the server. Some older versions of smbd produce this kind of behaviour when running ls or certain other tools.
View Tag Cloud
Ubuntu Forums Code of Conduct