-   Programming (
-   -   grep to NOT select a word (

robertmarkbram 08-21-2003 10:33 PM

grep to NOT select a word
Howdy All!

How can I write a regular expression that will exclude a whole word.

Here is what I have now:

ls -a | grep "^[^\.]"

This lists out all files in the directory and removes all file names that begin with a destop. I then want to weed one other: a file called "Desktop". Can I use grep to select everything NOT "Desktop"?

Thanks for any advice!


Dark_Helmet 08-21-2003 10:44 PM

grep -v pattern

robertmarkbram 08-21-2003 10:48 PM

Thank you.. errr.. Dark Helmet. :)

I shall check the man better next time!


All times are GMT -5. The time now is 09:33 AM.