26

Is there a Linux equivalent of the Windows Shift+Right-click sequence? I use this a lot on files and directories to get the 'hidden' "Copy as path" option in the pop-up menu. It saves a lot of typing (and typos) when using the command line.

I'm hoping that Linux has something similar, so I can go to the 'Files' window in a GUI (Gnome3 in my case) and just copy a file or directory location as a path and then paste it in a terminal window. This function would be especially handy in Linux given the heavy reliance on the terminal! Is this possible?

1
  • 2
    I don't know the answer to your question to be honest, but I do know that shells have tab completion, so that you can easily avoid typos. :)
    – schaiba
    Nov 25, 2013 at 19:04

1 Answer 1

40

If you click 'Copy' from the right-click context menu in Nautilus (file manager in GNOME3) and paste the contents in a text field (text editor, text box, etc.), it will paste the path instead of the file itself.

7
  • Works with Thunar (Xfce's file manager), too.
    – cjm
    Nov 25, 2013 at 19:53
  • 5
    Also works with nemo (Cinnamon's file manager).
    – terdon
    Nov 25, 2013 at 23:49
  • Works for me - thanks. Very obvious when you think about it, although coming from Windows that approach would try to copy the entire file or just do nothing if you tried to paste into a command-line/shell. Nov 26, 2013 at 7:58
  • 1
    @terdon nemo copies it as a file:// path, which means the encoding doesn't use bash escape Mar 17, 2016 at 13:44
  • 4
    it doesnt just paste the path of the file. it pastes additional information. my case: x-special/nautilus-clipboard copy file:///home/alexzander/Documents/preparing_for_linux.py and its not helpful at all when you want to paste the path into a python variable for example.
    – alexzander
    Apr 22, 2021 at 8:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .