August 17, 2008

Finding files in directories

This posting is about 'find' unix command.

Linux has services command to handle processes that need to come up at start up time, and shutdown when system comes down. I use Sparc Solaris, v9, and (may be I don't know if there is) I have to (or I still) manage it manually. Sometimes I have to find what sym links are in /etc/rc*.d/ for certain app -- I usually get this part wrong too often -- if I want to look for :
[sourcecode language='css']
$ find /etc/rc*.d -name "*tomcat*" -print
No quotes surrounding the directory pattern, no single/double quotes.

Here's an example:
[sourcecode language='css']
$ ls -ld rc*.d
drwxr-xr-x 2 root sys 1536 Aug 5 13:22 rc0.d
drwxr-xr-x 2 root sys 1024 Aug 5 13:22 rc1.d
drwxr-xr-x 2 root sys 2048 Aug 5 13:22 rc2.d
drwxr-xr-x 2 root sys 512 Aug 5 13:22 rc3.d
drwxr-xr-x 2 root sys 1536 Aug 5 13:22 rcS.d

$ find /etc/rc*.d -name "*tomcat*" -print

No comments: