How can I start Nautilus's "File Operations" GUI from the command line?
My goal is to include this in a Nautilus script.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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.
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" ""
/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).