bash find full path 1

bash find full path

find "$(pwd -P)" -name "filename"

Here is what the above code is Doing:
1. The -P option to pwd tells it to print the physical path of the current directory, rather than the logical path.
2. The -name option to find tells it to search for files with the given name.
3. The -exec option to find tells it to execute the given command on each file it finds.
4. The {} option to find tells it to substitute the name of the file it found into the command.
5. The \; option to find tells it that the command is finished.

Similar Posts