I'm doing:
$> df -kh | sed -n '/\/data\/WAS\/7.0\/wasap03/p'
/dev/xxxxx/xxxxx 5.0G 490M 4.2G 11% /data/WAS/7.0/wasap03
/dev/xxxxx/xxxxxxx 3.5G 72M 3.3G 3% /data/WAS/7.0/wasap03/xxxx/xxxx
/dev/xxxxxx/xxxxxxxxxx 3.5G 72M 3.3G 3% /data/WAS/7.0/wasap03/xxxx/xxxx/xxxx
$> df -kh | sed -n '/\/data\/WAS\/7.0\/wasap03/p' | awk {'print $5, $6'}
11% /data/WAS/7.0/wasap03
3% /data/WAS/7.0/wasap03/xxxxx/xxxxx
3% /data/WAS/7.0/wasap03/xxxxx/xxxx/xxxxx
My question is I only need the whole line containing only /data/WAS/7.0/wasap03
i.e the output should be only -> 11% /data/WAS/7.0/wasap03
, nothing more than this. Please do not say use head -1
, I need this only through sed.