Dolphin Plugin: Copy as path

I was missing the feature of Copy File Path in Dolphin (KDE File Manager). So I created one by myself. You need xclip installed for this.

Create a file named copy-path.desktop in the following directory.


For KDE5, use the following directory (thanks to Peter).


Then add the following lines to the file copy-path.desktop.

[Desktop Action copy-path]
Exec=echo "%U" | tr -d '\n' | xclip -selection clipboard
Name=Copy Path

[Desktop Entry]

I have added tr command to trim the newline which may cause a forced return while pasting the text in a terminal.

Now reopen Dolphin. A top-level context menu named “Copy as path” should appear. Clicking it will copy the absolute name of the file to clipboard.

Dolphin Copy File Path

2017-02-21 EDIT: Now you can copy directory path also!