Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Unix (http://www.go4expert.com/forums/unix-forum/)
-   -   Search a file in UNIX (http://www.go4expert.com/forums/search-file-unix-t21667/)

Poonamol 5Apr2010 15:44

Search a file in UNIX
 
Hi,

How can I search any file in Unix from home directory?
File is in sub directory. Search a file in dir and sub dir.

Thanks in advance.

en_7123 6Apr2010 10:10

Re: Search a file in UNIX
 
Use the find command.Read the man page

Poonamol 6Apr2010 10:32

Re: Search a file in UNIX
 
Thanks for your reply.
I got it

find / -name "filename.extension" This lists all paths of the file in dir and subdirs also.:)

kumarmannu 11Feb2011 15:22

Re: Search a file in UNIX
 
Find files with the Linux find command : This first Linux find example searches through the root filesystem ("/") for the file named "Chapter1". If it finds the file, it prints the location to the screen. find / -name Chapter1 -type f -print A nice thing to know is that on Linux systems and modern Unix system you no longer need the -print option at the end of the find command, so you can issue it like this: find / -name Chapter1 -type f This next find command searches through the /usr and /home directories for the file named Chapter1: find /usr /home -name Chapter1 -type f To search in the current directory, and all subdirectories, just use the . character to reference the current directory in your find commands, like this: find . -name Chapter1 -type f

shivkumar2 17Jan2012 16:52

Re: Search a file in UNIX
 
find / -name file name -to find file and driectory in linux.


All times are GMT +5.5. The time now is 06:16.