I have access to the server in question. I know the name of the directory I’m looking for on the server, but don’t know the full path to it.
Is there a way for me to retrieve the full file path to the directory by using the the directory name?
Edit: I don’t have shell access.
2
Answers
if you have shell access you can use
find
like the followingwhere / is the search starting point and replace DIRECTORYNAME obviously, also try
man 1 find
for more information.You can use
locate
commandlocate DirectoryName
Its format is something like this
locate [option] [search-pattern]
Note: In the command below, the option –basename or -b tells locate to only match the file (directory) basename (which is exactly pkg) but not the path (/path/to/pkg). Where is a globbing character, it disables the implicit replacement of pkg by pkg.