Search a file in UNIX

Go4Expert Member
5Apr2010,15:44   #1
Poonamol's Avatar
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.
Ambitious contributor
6Apr2010,10:10   #2
en_7123's Avatar
Use the find command.Read the man page
Go4Expert Member
6Apr2010,10:32   #3
Poonamol's Avatar
Thanks for your reply.
I got it

find / -name "filename.extension" This lists all paths of the file in dir and subdirs also.
Banned
11Feb2011,15:22   #4
kumarmannu's Avatar
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
Light Poster
17Jan2012,16:52   #5
shivkumar2's Avatar
find / -name file name -to find file and driectory in linux.