Filter not working
All,
I'm running the cmd: Code:
locate -i notes | grep -i dropbox --exclude-dir=[\*ProJects*\} | grep \.doc > /home/files/notes_dump.txt && gedit /home/files/notes_dump.txt What is not right with my grep statement? Thanks! TBNK |
Code:
--exclude-dir=[\*ProJects*\} |
Quote:
Thanks for the bracket check, but still getting this/these directories in the output: Code:
/home/files/Dropbox/ProJects/Web/External Projects/ So what is The Ezekiel Project? Cheers! TBNK |
Can I get some help here?
|
I think the problem is that the o/p of 'locate' is effectively a bunch of strings (as opposed to eg grep -r , which is actually reading the dir nodes content ).
Try using 'grep -v' or even 'egrep -v' on the 'locate' o/p. HTH |
don't use locate for changing, user created content.
also, since you are piping locate's output to grep, i don't think the --exclude-dir option makes any sense there. please explain what you are trying to achieve, we will help you formulate a better command. |
You did not tell us how did you fix that problem in post #2. So how can we go further?
|
Followup
All,
Following up on all my open threads, looking to close/solve them all. Cheers! TBNK |
Moderator Response
Do not bump necro threads unless you have relative content as OP;
Quote:
|
Quote:
Quote:
You can try: Quote:
-r = for recursive search Good luck! |
this is completely wrong.
--exlcude-dir has only any effect if you use recursive search (grep -r), not when grepping stdin. From the other hand grep -v <pattern> may work (as it was already suggested). Quote:
|
All,
As a KDE user, I normally use "KFind" which searches the entire system including any flash drives active, but kfind sometimes blows on install, so not always available. Both "find" and "locate" are limited to the "/home" directory! What is needed is a command line equivalent of "kfind" that will search the entire system by default. I'll try to find the right board to post this one so the OS level gurus will create the right command for this! If anyone has a bash script that equals "kfind"; I'll go ahead and mark this solved. Please share if you have such a script! Cheers! TBNK |
Quote:
|
All times are GMT -5. The time now is 09:02 AM. |