Okay, here's what I'm trying to do, hopefully someone can help. My knowledge of Linux is limited, though I'm working on fixing that even now.
I want to grep a series of flat-files, (more than 2000) for a specific word. If that word is found, then I want to move that file to another directory.
I know I need to write a script to do it, but I don't know how. Any suggestions? :)
I want to grep a series of flat-files, (more than 2000) for a specific word. If that word is found, then I want to move that file to another directory.
That will find all files ending in .txt in the current directory and subdirectories, grep them for "wordtosearchfor", then move each file to /path/to/new/dir if the word was found. Find can be overkill if you have a simple directory structure and don't have any criteria other than the filename for which files you want to grep. As with anything in unix, there's more than one way to do it.
My knowledge of Linux is limited, though I'm working on fixing that even now.
I want to grep a series of flat-files, (more than 2000) for a specific word.
If that word is found, then I want to move that file to another directory.
I know I need to write a script to do it, but I don't know how.
Any suggestions? :)
Thanks!