Friday, November 4, 2011

Useful one liners : UNIX cut

sajang@ubuntu64:~/Documents/cpp$ df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 94G 13G 76G 15% /
udev 492M 4.0K 492M 1% /dev
tmpfs 200M 764K 199M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 500M 152K 500M 1% /run/shm
ubuntu-share 298G 108G 190G 37% /media/sf_ubuntu-share
sajang@ubuntu64:~/Documents/cpp$ df -h | cut -d" " -f2- | sed 's/^ *//g'


Size Used Avail Use% Mounted on
94G 13G 76G 15% /
492M 4.0K 492M 1% /dev
200M 764K 199M 1% /run
5.0M 0 5.0M 0% /run/lock
500M 152K 500M 1% /run/shm
298G 108G 190G 37% /media/sf_ubuntu-share


sajang@ubuntu64:~/Documents/cpp$ df -h | cut -d" " -f2- --complement


Filesystem
/dev/sda1
udev
tmpfs
none
none
ubuntu-share

No comments:

Post a Comment