Home » Questions » Computers [ Ask a new question ]

How much space is available on the device containing a given file

How much space is available on the device containing a given file

In linux, given a path to a file, is there any way to tell which filesystem it is on?

Asked by: Guest | Views: 271
Total answers/comments: 2
bert [Entry]

"Run

df -k /home/itsadok/bananas

(-k for size in kilobytes, you can ignore it if you don't want it)

This will give you the size left for only the filesystem containing the file, at least on AIX."
bert [Entry]

"Since this is in a script:

stat -fc '%a * %S' -- ""$fname"" |bc"