Re: Locate with exclude?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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.


  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux