View previous topic :: View next topic |
Author |
Message |
henning_bravo Apprentice
Joined: 11 Apr 2007 Posts: 197
|
Posted: Wed Jun 27, 2007 2:15 pm Post subject: Find files that contains a word |
|
|
Hello
Can someone please help me with a command that searches through a folders files and saves all filenames that contains the word searching for in a new file.
I tried with something like this, but it doesn't work:
Code: | find . -type f -exec grep -H 'word' {} \; > file.txt |
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Wed Jun 27, 2007 2:17 pm Post subject: |
|
|
|
|
Back to top |
|
|
henning_bravo Apprentice
Joined: 11 Apr 2007 Posts: 197
|
Posted: Wed Jun 27, 2007 2:30 pm Post subject: |
|
|
Perfect!
Since you are so good at that you will be given the honor to correct one I think is right.
Is the command
Code: | find / -type f -atime -1 |
correct if I want to get a list of all files that has been accessed less than two days ago? |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3925 Location: Hamburg
|
Posted: Wed Jun 27, 2007 2:58 pm Post subject: |
|
|
If accessed means changed, it should be well. |
|
Back to top |
|
|
henning_bravo Apprentice
Joined: 11 Apr 2007 Posts: 197
|
Posted: Wed Jun 27, 2007 3:01 pm Post subject: |
|
|
toralf wrote: | If accessed means changed, it should be well. |
Thanks! |
|
Back to top |
|
|
|