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 |
|
Use the find command.Read the man page
|
|
Go4Expert Member
|
|
| 6Apr2010,10:32 | #3 |
|
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 |
|
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 |
|
find / -name file name -to find file and driectory in linux.
|
