Ankit Singh Ankit Singh - 1 year ago 62
Linux Question

How to look up a file and get its full path relative to current directory?

Using the terminal, till now I have not been able to figure out how to find a file(relative path from current directory) which may lie several layers below in the directory structure.
The best I figured out is :

ls -R | grep file_name

But this gives me only the filename.

Answer Source

The answer is in ring bearer comment. I will just mark it here so that other people having the same issue can easily take the answer home.

use find command as find . -name file_name

or if you don't know the filename but just a part of the file name then you can use this find . -name *file_name_part*