Copy To, Move to in Caja

Hello,
I am a using linux from a while but a new user of ubuntu mate. Before mate I was using Linux mint. in linux mint file manager (Nemo) if I right click on a file I have an option copy to or move to by using that I can copy or move any file into home, Documents, Video, Music etc. but in mate file manager (Caja) I don't have these option. any help regarding this to make life a little easier.

thank you so much in advance!

I also think copy / move to is pretty lame in CAJA. My work around is copy or cut the selections and paste into the desired location.

1 Like

if caja team insert mentioned folder in copy to/move to menu. it will become easy job.

There are a few use-cases where the copy/move to dialog definitely isn’t lame :slight_smile: For example, where you’re copying files to multiple locations, in which case you’d just select the destination after engaging the dialog, and then kick off the next transaction without having to re-navigate. OP has a point. :wink:

@shahmoeen See here - Move to .. , Copy to .. in Caja I’ve changed the scripts minutely to improve them.

These scripts should be placed in .config/caja/scripts/ where they will be available on a right click of your file, Scripts>.

copy_to is as follows -

#!/bin/bash
numberArgs=$#

OUTPUT=$(zenity --file-selection --directory --title="Choose your target directory")

if [ "$?" -eq 1 ]; then
    zenity --error --text="Cancelled"
    exit 1
fi

TARGETDIR=$(awk -F, '{print $1}' <<<$OUTPUT)

 for (( i=1; i<=$numberArgs; i++ )); do
    echo "# ${1##*/}"
    cp -p -r "${1}" "$TARGETDIR/"
    echo "$(( (i * 100)/$numberArgs ))"
    sleep 0.5 
    shift 1
done | zenity --progress --title="Copy files to $TARGETDIR" --percentage=0

if [ "$?" -eq 1 ]; then
    zenity --error --text="Cancelled!"
    exit 1
fi

move_to is as follows -

#!/bin/bash
numberArgs=$#

OUTPUT=$(zenity --file-selection --directory --title="Choose your target directory")

if [ "$?" -eq 1 ]; then
	zenity --error --text="Cancelled"
# --auto-close
	exit 1
fi

TARGETDIR=$(awk -F, '{print $1}' <<<$OUTPUT)

for (( i=1; i<=$numberArgs; i++ )); do
	echo "# ${1##*/}"
	cp -r --preserve=all "${1}" "$TARGETDIR/"
	rm -r "${1}"
	echo "$(( (i * 100)/$numberArgs ))"
	sleep 0.5
	shift 1
done | zenity --progress --title="Copy files to $TARGETDIR" --percentage=0 
# --auto-close

if [ "$?" -eq 1 ]; then
	zenity --error --text="Cancelled!" 
# --auto-close
	exit 1
fi
2 Likes

Hello shahmoeen

I missed this post back in 2017... perhaps you are still using Ubuntu-Mate...

I use those commands in conjunction with the F3 key (which opens a second pane in Caja). I navigate in the second pane to where I want the file(s) to be copied/moved to.

Hope this helps you or others. :slightly_smiling_face: