df -h不能显示为一行的问题

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p1 20G 1.9G 17G 10% /
tmpfs 12G 0 12G 0% /dev/shm
/dev/mapper/skylvm-app
121G 97G 17G 86% /app
/dev/mapper/skylvm-app1
121G 62G 53G 55% /app1
/dev/mapper/skylvm-app2
121G 197M 114G 1% /app2

 

当Filesystem 太长时,无法显示为一行,这样给脚本的批量执行带来很大的问题,

经过看帮忙和多方资料尝试,可以这样解决

其实加上-P参数就可以,

df -hP
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p1 20G 1.9G 17G 10% /
tmpfs 12G 0 12G 0% /dev/shm
/dev/mapper/skylvm-app 121G 97G 17G 86% /app
/dev/mapper/skylvm-app1 121G 62G 53G 55% /app1
/dev/mapper/skylvm-app2 121G 197M 114G 1% /app2

-P, --portability
use the POSIX output format

你可能感兴趣的:(问题,df,-h不能显示,为一行)