How to find the disk space left for a file on Linux

How to find the disk space left for a file on Linux? For example, a program may append data to a file:

/mnt/logs/app-log.log

How to find which partition the app-log.log is on and how much disk space left on that partition?

Use this command:

$ df -B1 /mnt/logs/app-log.log | tail -1 | cut -d' ' -f4

It will displays the available disk space in bytes.

Leave a Reply

Your email address will not be published. Required fields are marked *