useful find

jplindstrom on 2005-01-11T13:48:36

The find command is very useful but very, very poorly documented. Not that the options aren't mentioned in the man page, but that doesn't help me understand how to use the program. I had to Google to find the correct usage of "-perm +u=w".

What's missing is a couple of examples of the options in actual use. Like... the SYNOPSIS section of Perl module docs! That's really something they got right.

So to find files not added or checked in to SourceSafe (yuck!), here's how to do it. List using less, but don't wrap lines (-S)

find . -perm +u=w ! -type d ! -name 'vssver.scc' ! -name '*~' ! -name '#*#' | less -S


Unfortunately there's a FIND.EXE in Windows as well. Renaming FIND.EXE to WFIND.EXE doesn't work because Windows seems to restore that file automatically. I put Cygwin before c:\winnt in the PATH.


ORA: Unix Power Tools

lachoy on 2005-01-11T16:14:40

Unix Power Tools (a really valuable book) has a whole chapter on find. (I only have the 2nd ed, but it looks from the table of contents that the 3rd does too.)