How to find the path for a given file


How can I find the directory for a file?

In my Unix shell, I know how to use the ls command, but it shows just the name of the file. I need the path too. How do I get it?

Best Answer

echo "$PWD/filename" will print the name of the filename, including the path.

Related Question