1829603 Members
1788 Online
109992 Solutions
New Discussion

find out the file !!!!

 
abhijeet_7
Advisor

find out the file !!!!

Hello gurus,
i want to search for a file which i don't know
where is located( i have lost its path)

also i want to search for a file belonging to
a user browsing all the directories.
It must browse all directories & should display its path.

How can it be done?
Thanks & Regards

ABHI K
we work, to become...not acquire
6 REPLIES 6
Ravi_8
Honored Contributor

Re: find out the file !!!!

Hi,

#find / -name -print
never give up
RAC_1
Honored Contributor

Re: find out the file !!!!

man find

find /all_dirs_one_by_one -type f -name "File_name"

find /all_dirs_one_by_one -user "user_id"

Anil
There is no substitute to HARDWORK
abhijeet_7
Advisor

Re: find out the file !!!!

Anil,
thanx!!

but do u mean to say
i should type "/all_dirs_one_by_one"
at the prompt?

Awaiting reply,
ABHI K
we work, to become...not acquire
Stefan Schulz
Honored Contributor

Re: find out the file !!!!

Hi,

if you know the exact filename just do:

find / -tpye f -name "filename" -print

If you search for a special file owned by a special user expand the above command to:

find / -type f -name "filename" -user "userid" -print

This will search through all files on your server and also on every mounted filesystem. Be careful this can take very long.

Do a man find for all the options of this command.

Hope this helps

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
HGN
Honored Contributor

Re: find out the file !!!!

Hi

You can use the find command like

find / -name -print (* is if you are not sure of the name)

Rgds

HGN
RAC_1
Honored Contributor

Re: find out the file !!!!

No you do not type that. you do it for all mount points you have. running it on / can cause cpu hog.
e.g.

find /home -type f -name "file_name"
Will look for the file "file_name" in /home

Anil
There is no substitute to HARDWORK