find a file or directory under public_html

Hi there,

I have a quick question about the UNIX command find, if you can help me I will appreciate it...

I am trying tho find a file which is under my 'public_html' directory.
As I know, I am making the command > find ~ -name filename(or directory name) to find the file or directory under my root directory(UNIX account). However, this command does not work for the files&directories which exist under my public_html directory. Then, I found a new command such as: > find /var/www/myloginname -name filename -- this commands works, and it finds the file or directory under my public_html directory. On the other hand, what if I don't know where the file or directory is, that is, whether it is under pubic_html or not.... Is there not a command which when applied under root directory it finds all files, also the ones which are under my public_html directory ???

Any sugestions??? :confused:

find / -name <filename>

will make a search for the file in the whole of root dir... if you don't have read permissions to most of the sub-dirs which is mostly the case, you will have to see lot of "permission denied"

the ~ stands for the users directory like /home/user/ , so that ~buddy becomes /home/user/buddy

~ stands for your home directory effectively saying

cd and cd ~ and cd $HOME are all same...

yeah, I know this command already, however it searches the whole system, this is not what I want. I want to make the search under my home directory...
EX: Think that I have a file named Commands under --> /user/s2/milhan/SQL directory (/milhan is my home directory). then when I make > find ~ -name Commands it finds and gives me the path: /user/s2/milhan/SQL/Commands. That's what I am trying to do for the files under my public_html directory, /user/s2/milhan/public_html (/milhan is my home directory). Say, I have a directory called hw1 under /user/s2/milhan/public_html/15a directory, and I don't know where it is... How can I find this directory?

You can try

(find / -name filename > /dev/tty) >& /dev/null

This will avoid error messages to be printed on screen.