Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ df -H
Filesystem             Size   Used  Avail Use% Mounted on
                        34G    12G    21G  35% /
tmpfs                  8.4G      0   8.4G   0% /dev/shm
/dev/sda1              508M    54M   429M  12% /boot
                        19G   309M    17G   2% /home

I want to run a disk monitor script but because the filesystem is so long the row has been split into two lines and the script fails.

Any suggestions?

share|improve this question
up vote 1 down vote accepted

Try df -P It will use posix format

share|improve this answer
what exactly is posix format? – DD. Jun 8 '12 at 10:30 - basically, it's a defined standard to which all Unix-like POSIX compliant operating systems 'try' to adhere. It defines the format of a lot of stuff. – EightBitTony Jun 8 '12 at 11:52
Do people still recommend setting LANG=C in scripts before interpreting the output from commands, in case LANG=somethingweird causes your script to fail? – EightBitTony Jun 8 '12 at 11:54

I am using this line:

df -PTlk -x smbfs -x tmpfs -x cifs -x iso9660 -x udf -x nfsv4 | sed 1d

(stolen from Check-MK Agent)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.