How can I start Nautilus's "File Operations" GUI from the command line?

File Operations

My goal is to include this in a Nautilus script.


The short answer is, you can't. Nautilus is not built to allow that sort of thing and you can go through the source code of nautilus and look at the file copy/move sections to see how it works.

Part of this lack of integration was the motivation behind the progress indicator design. It would replace the nautilus progress window and several other progress inconsistencies and allow multiple programs to show their progress to the user in the same way:


More work and advocacy for these new designs would help, allowing integration of all sorts of tools.


From a discussion in irc://irc.gnome.org#nautilus, I can say that the current version of Nautilus do not expose methods for file operation on D-Bus, but version 3.0 will do, so the answer should be

you can't, now, but you will in the future


Apparently this is now supported; at least the following seems to work under 12.04:

qdbus org.gnome.Nautilus /org/gnome/Nautilus org.gnome.Nautilus.FileOperations.CopyFile "file:///source/directory" "*" "file:///destination/directory" ""

where /source/directory is the absolute path to your source directory, * is the glob for file[s] to copy, /destination/directory is your destination directory and the last "" is for destination file name. Note that you need to have the last one there even if it's empty as in here, to fulfill the method signature. Also, if you specify a target name and have multiple source files, they'll all get copied to that one destination file, giving an overwrite prompt for each file after the first one (which may or may not be what you want).

  • Jani Uusitalo's answer works on nautilus 3.4.2 , Ubuntu 12.10 – totti Mar 31 '13 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.