0

I tried using the command

 sudo find / -type d -iname firefox  

It gave me the following output

/usr/share/doc/firefox
/usr/lib/firefox
/home/ashu/.mozilla/firefox
/etc/firefox

But i have a directory named firefox located at

/usr/local/sbin/in

why is not it listed here ?

user9517
  • 115,471
  • 20
  • 215
  • 297
Bunny Rabbit
  • 103
  • 2

3 Answers3

2

Most probably because /usr/local/sbin/in (or one of the earlier components) is a symlink to another directory. find doesn't follow symlinks by default; use -follow or -L to change this, but be aware that it can lead to find looping over a directory tree.

geekosaur
  • 7,175
  • 1
  • 20
  • 19
2

Is it named just firefox? Is does not have version numbers attached to the name? You are not using wildcards in your find statement, so a directory called firefox-3 will not be found.

wzzrd
  • 10,409
  • 2
  • 35
  • 47
1

Since you mentioned geeokosaur was right, you can use this form to include the direct symlink:

sudo find / \( -type d -o -xtype d \) -iname firefox  

Or as geekosaur, suggested already, use find -L as that also deals with the case where (say) /usr/local/sbin is a symbolic link.

James Youngman
  • 344
  • 1
  • 8