![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 6 | 10-25-2008 09:37 AM |
| Find Oldest file in a directory tree | rahulrathod | Shell Programming and Scripting | 24 | 06-05-2008 03:01 PM |
| find the length of file names in a directory? | koti_rama | Shell Programming and Scripting | 5 | 06-04-2008 07:19 AM |
| find full directory and delete old dated file? | xramm | Shell Programming and Scripting | 2 | 07-07-2007 06:56 AM |
| how to find a corrupted file in a directory | skarthik_d | UNIX for Dummies Questions & Answers | 1 | 07-04-2006 07:45 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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??? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
~ stands for your home directory effectively saying
cd and cd ~ and cd $HOME are all same... |
|
#4
|
||||
|
||||
|
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? Quote:
|
|
#5
|
|||
|
|||
|
You can try
(find / -name filename > /dev/tty) >& /dev/null This will avoid error messages to be printed on screen.
__________________
Thanks Vikas Srivastava |
|||
| Google The UNIX and Linux Forums |