I'm trying to get the file size of a big file (1GB +) using the OS X Terminal. I'm using
du -sh. But also after 30 seconds I don't have any result, is there any faster command?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Say you are looking for big files in your home directory, use this command:
find ~ -size +1G
Replace ~ with the directory of interest.
My original response was wrong, but I'll keep it to remind myself. If you are trying to get the size of a file, try this:
stat -f '%z' filename # Normal file stat -L -f '%z' filename # symbolic link file
I have not figure out how to do it for a directory yet.