Locate with exclude?
Mikkel L. Ellertson
mikkel at infinity-ltd.com
Mon Feb 19 19:37:34 UTC 2007
Steve Searle wrote:
> Around 01:20am on Monday, February 19, 2007 (UK time), Jean-Rene David scrawled:
>
>> Another, shorter, way to do the same:
>>
>> ps auxw | grep '[p]rocessName'
>
> I like it, but can you explain why it works?
>
Regular Expressions. The [ ] specify a range to match. In this case,
it only matched p so grep is looking for processName, and because
the grep command has [p]rocessName it does not match. You can do
things like "ls /dev/[sh]d*" will give a list of all sd and hd
entries in the /dev directory. There is a lot more to it, but this
gives you a small idea of the power of regular expressions.
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
More information about the fedora-list
mailing list