-->

Linux : full path of a file

Hello ,

Sometimes we need to have full or absolute path of file. And most of the times we used to pwd + filename manually.

But with google search I came across a command named as readlink.


readlink -f filename.txt

that will print complete path of filename along with filename append to it.

linuxmen@linuxmen-fresh:~/test/test1$ readlink -f ex4.js
/home/linuxmen/test/test1/ex4.js
linuxmen@linuxmen-fresh:~/test/test1$  

Note : make sure you are same directory where file resides else give relative path to file.

Hope it helps
Share on Google Plus

About RAJA SEKHAR REDDY GENUPULA

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.