I had to recently list a couple of php files and I ran the following find command – find . -name “*.php”. Bam, nothing. Went through the man page of find to make sure that find is recursive by default without using any special operator and the man page confirmed this. Hmm, what might be wrong? Did an ls -alt and saw that all my directories are symlinks. Would this affect find? Again read the man page to check this out and glanced upon that find does not follow symlinks unless you use the -L flag. Ran the command again with find -L . -name “*.php” and got the list of the files I was looking for. Every day you learn something new :).

Advertisements