Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
$ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/mapper/vg_app001-lv_root
                        34G    12G    21G  35% /
tmpfs                  8.4G      0   8.4G   0% /dev/shm
/dev/sda1              508M    54M   429M  12% /boot
/dev/mapper/vg_app001-lv_home
                        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
add comment

2 Answers

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
    
en.wikipedia.org/wiki/POSIX - 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
add comment

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
add comment

Your Answer

 
discard

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.