LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Output of full file path (https://www.linuxquestions.org/questions/linux-software-2/output-of-full-file-path-4175457159/)

eldiener 04-06-2013 05:07 PM

Output of full file path
 
Given a file in a directory, is there an easy way to copy the full file path so it can be pasted elsewhere ? From a console ? From a file manager ?

David the H. 04-06-2013 05:12 PM

There are at least two applications that let you interface with the x selection mechanism: xsel and xclip.

To get the full and actual path of a file, try readlink.

e.g. to copy the full path of a file to the selection for (middle-click) pasting:
Code:

readlink -f filename | xsel -i

Habitual 04-06-2013 05:13 PM

Using thunar here, I tried highlighting and Ctrl+c and my clipboard now contains this string
file:///home/jj/Documents/ftpcron.out

YMMV, but me thinks it may be possible in another DE.

Habitual 04-06-2013 05:50 PM

Quote:

Originally Posted by David the H. (Post 4926518)
There are at least two applications that let you interface with the x selection mechanism: xsel and xclip.

Thanks David the H! This is exactly what I needed also.

I use to have these installed and use[d] 'em here and there. They work. ;)

jpollard 04-06-2013 08:46 PM

How about:
Code:

echo $(pwd)/filename
The pwd prints the current working directory path...


All times are GMT -5. The time now is 10:47 PM.