The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find Oldest file in a directory tree rahulrathod Shell Programming and Scripting 25 01-12-2009 12:45 PM
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 12:37 PM
find the length of file names in a directory? koti_rama Shell Programming and Scripting 5 06-04-2008 10:19 AM
find full directory and delete old dated file? xramm Shell Programming and Scripting 2 07-07-2007 09:56 AM
how to find a corrupted file in a directory skarthik_d UNIX for Dummies Questions & Answers 1 07-04-2006 10:45 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-21-2002
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
Smile 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???
  #2 (permalink)  
Old 10-21-2002
Vishnu Vishnu is offline
Registered User
  
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
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 (permalink)  
Old 10-21-2002
Vishnu Vishnu is offline
Registered User
  
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
~ stands for your home directory effectively saying

cd and cd ~ and cd $HOME are all same...
  #4 (permalink)  
Old 10-21-2002
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
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:
Originally posted by Vishnu
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
  #5 (permalink)  
Old 10-23-2002
vikas_sri vikas_sri is offline
Registered User
  
 

Join Date: Oct 2002
Location: United Kingdom
Posts: 9
You can try

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

This will avoid error messages to be printed on screen.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0