Search a file in UNIX

Poonamol's Avatar, Join Date: Mar 2010
Go4Expert Member

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's Avatar, Join Date: Feb 2010
Ambitious contributor
Use the find command.Read the man page
Poonamol's Avatar, Join Date: Mar 2010
Go4Expert Member
Thanks for your reply.
I got it

find / -name "filename.extension" This lists all paths of the file in dir and subdirs also.
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
shivkumar2's Avatar
Light Poster
find / -name file name -to find file and driectory in linux.