From: Peter Hickman Date: 2012-09-08T06:00:20+09:00 Subject: Re: regix in grep or something like this Uh, here we go again. What did you try after your last post. You should be able to do this with only the most basic of Ruby knowledge. This is what "df -h" gives me... # Filesystem Size Used Avail Capacity Mounted on # /dev/disk0s2 465Gi 389Gi 75Gi 84% / # devfs 191Ki 191Ki 0Bi 100% /dev # map -hosts 0Bi 0Bi 0Bi 100% /net # map auto_home 0Bi 0Bi 0Bi 100% /home # /dev/disk2s2 1.4Ti 504Gi 893Gi 37% /Volumes/Backup # /dev/disk1s6 466Gi 305Gi 161Gi 66% /Volumes/Spare def mount_check(drive_path) %x{df -h}.split(/\n/).each do |line| if line.split(/\s+/).first == drive_path return true end end return false end mount_check("/dev/disk0s2") => true The only point to note is you must give the full drive path, /dev/disk0s2, rather than just part of it, such as disk0s2. Also this solution and your solution has absolutely nothing to do with regexs at all. Please at least attempt to learn how to program before posting another question.