How can I copy the file and folders full path in Nautilus? In the right-click context menu there is no such option provided. In file/folder property window I can only copy the folder path.
Unfortunately pasting file path from Nautilus to GNOME Terminal does not work as expected. It pastes the path as an URL with URL encoded characters. For example it pastes:
Solution with clipboard
Use the Edit > Paste Filenames function from the terminal menu which also takes care of escaping for a shell. Unfortunately this function does not have a keyboard shortcut (besides Alt+E+F) and it seems that it is not possible to set one using
Solution with drag & drop
Dragging a file or directory from Nautilus to GNOME Terminal transfers the correctly formatted path like Edit > Paste Filenames mentioned above.
I found a solution to this. You can use Nautilus actions utility to add "Copy path" and "Copy directory path" the the context menu.
This seems to work well.
Source. Don't forget to make the .py-file executable.
- Install Filemanager-Actions, and xclip:
sudo apt-get install filemanager-actions nautilus-actions xclip
- Run FileManager-Actions, and create a new action like so:
- Hit button "Define a new action"
- Name the action in the "Items list", e.g. "Copy path to clipboard"
- Under the "Action" tab, check the two options "Display item in selection context menu", and "Display item in location context menu"
- Under the "Command" tab, set path to "bash", and "Parameters" to
-c "realpath -z %B | xclip -selection clipboard"
- Hit the button "save the items tree"
- restart nautilus: "nautilus -q"
- Now you should be able to right click a file/folder, and see the action we just defined to copy the path