The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: grep question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-29-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by melanie_pfefer View Post
hello people,

All my servers have 4 mounts with this norme. For example, if my hostname is siroe.

df -h | grep `hostname`

/dev/dsk/c1t3d0s6 404G 399G 800M 100% /siroe3
/dev/dsk/c1t2d0s6 404G 399G 800M 100% /siroe2
/dev/md/dsk/d6 20G 812M 19G 5% /siroe
/dev/md/dsk/d12 167G 164G 918M 100% /siroe1

I want to get only these:

/siroe3
/siroe2
/siroe1

how to do that?

thanks

Code:
df -h | grep `hostname` | sed -n -e "s#.* \(\/.*\)#\1#p"