How to use ‘-prune’ option of ‘find’ in sh?

I don’t quite understand the example given from the man find, can anyone give me some examples and explanations? Can I combine regular expression in it? The more detailed question is like this: Write a shell script, changeall, which has an interface like changeall [-r|-R] “string1” “string2”. It will find all files with an suffix … Read more

find without recursion

Is it possible to use the find command in some way that it will not recurse into the sub-directories? For example, DirsRoot |–>SubDir1 | |-OtherFile1 |–>SubDir2 | |-OtherFile2 |-File1 |-File2 And the result of something like find DirsRoot –do-not-recurse -type f will be only File1, File2? 4 Answers 4

“find: paths must precede expression:” How do I specify a recursive search that also finds files in the current directory?

I am having a hard time getting find to look for matches in the current directory as well as its subdirectories. When I run find *test.c it only gives me the matches in the current directory. (does not look in subdirectories) If I try find . -name *test.c I would expect the same results, but … Read more

Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”

Being forced to use CVS for a current client and the address changed for the remote repo. The only way I can find to change the remote address in my local code is a recursive search and replace. However, with the sed command I’d expect to work: find ./ -type f -exec sed -i “s/192.168.20.1/new.domain.com/” … Read more

How to use ‘find’ to search for files created on a specific date? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 8 years ago. Improve this question How do I use the UNIX command find to search for files created on a specific date? 9 Answers … Read more