1

As of right now, if I want to duplicate a folder or file, I right click on it, choose 'copy', click on nautilus itself to change focus from current folder/file, right click somewhere else and choose 'paste'.

Is it possible to duplicate a folder or file directly, like through a 'right click' -> 'duplicate' in nautilus?

Parto
  • 15,325
  • 24
  • 86
  • 117

1 Answers1

2

Inbuilt shortcut

You can drag files while holding down CTRL to copy them.

Keyboard independent solution using a Nautilus script

Here's a short Nautilus script that should cover your use case:

#!/bin/bash
#Nautilus script to duplicate selected files/folders

while [ $# -gt 0 ]; do

    echo "$# file(s)/folder(s) left to duplicate."
    ORIGINALITEM="$1"    
    DUPLICATEITEM="${ORIGINALITEM} (copy)"
    cp -r "$ORIGINALITEM" "$DUPLICATEITEM"
    shift

done
echo "Done."

Installation instructions

Note: This is a very simple script and will fail if a duplicate file of the same naming scheme already exists in the same directory. It's also not as elegant as the naming Nautilus does by default ( (copy) is inserted after the extension).

Glutanimate
  • 21,393