In a script in am working on I need to find out the allocated
size of a sparse file.
The only command that comes to mind is "ls -lh"
The "du -h" command is not appropriate because it will show
the occupied size and not the allocated size.

I don't know how to parse out to the position in the output of that
"ls -lh" command to pickup the file size value.

Is there some other way to do this?


reza wrote:
> Does this work for you
>
> $ ls -lh | awk '{print $5}'
>
> 132B
> 0B
> 3.8k
> 512B
> 3.9k
> 512B
> 512B
> 14M
> 512B
>
>

Thanks that works for me.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to