Edit added on 20200322 relevant to a future version of Dolphin:
Dolphin has a new “Duplicate” feature that can be used to quickly create copies of selected items (me: Nate Graham, Dolphin 20.04.0)
I too feel the need to sometimes copy/paste the same file in its current location. Obviously, the filename has to be modified somewhat. Dolphin does not automatically provide names such as
example.txt - Copy,
example.txt - Copy (2),
example.txt - Copy (3) to distinguish copies from the original but provides an interface allowing the user to modify the filename of each copy made.
I prefer the simpler route of adding timestamps with the help of Dolphin Service Menus as described below.
Consider a file titled
out.mp4. The image below shows the original and a few copies with time stamps.
Making timestamped copies using Service Menus in Dolphin.
Service Menus allow users to customize the context menu of Dolphin to provide additional features.
dkb is to be changed appropriately).
In there, create an empty text file named
Paste in the following content:
[Desktop Action copy-with-stamp]
Name=Add timestamp as suffix
and save the file as plain text.
Exec=cp-with-timestamp.sh %U in which
cp-with-timestamp.sh is an executable with the following content:
cp "$@" "$@"-"$(date +%Y%m%d%H%M%S)"
You can make the timestamp more or less elaborate depending on your needs.
man date explains how. But you must ensure that
cp-with-timestamp.sh is executable (which can be done in Dolphin itself) and stored in your
$PATH (or provide the entire path and filename in the
Exec=line). I have
~/bin in my
$PATH and so I keep
Once you've created both the .desktop file and the executable script, you can right-click on any file in your home folder and see the context menu option:
Note that my context menu isn't standard: I've removed some things, added others.
There's a long thread on Service Menus at Kubuntu Forums
People develop and contribute Service Menus over at the KDE Store. One caution is to make sure you're considering Service Menus relevant to your KDE Plasma version.
For people coming from other operating systems, safe names for files and folders maybe worth a read so that the implications of using spaces,
), etc are well understood.