[TriLUG] bash question

Magnus magnus at trilug.org
Wed Oct 17 13:40:43 EDT 2007


Joseph Mack NA3T wrote:
> I would like to find all the hard disks on a machine
> so I'm querying /etc/fstab. I can handle excluding
> /proc etc with a series of "grep -v foo" in the line
> (see commented grep line in function below, which works 
> fine).

Try this:

awk '{ print $4 }' /proc/partitions | grep -e '^[h,s]d.$'



More information about the TriLUG mailing list