Your specific error is caused by not using the
--execute option properly. If you look at the excerpt from the man page below, you'll note that
--execute does not have an equals sign listed as part of the syntax, as it simply executes the entire rest of the command line. An example of correct use would be:
gnome-terminal --execute play '/home/cjohnson/Still Alive.mp3'
cd is a bit of a special case, anyway.
cd is not like most commands—it does not launch a binary/executable of its own. It is interpreted directly by
bash (or whatever shell you are using). Therefore attempting to invoke
cd doesn't agree with the
-x flags (which seem to want to directly spawn a child process). The same issue will occur (I've checked) with other commands which are directly processed by
home. Even if used properly, without the equals sign, it will still result in an error: "File or directory not found." Therefore using the
--working-directory=[DIRECTORY] option is your best bet for doing what you want to do.
ANOTHER IMPORTANT NOTE:
Even if this weren't the case, you would still run into trouble. The problem lies in trying to use the
--execute option when you actually intend the meaning of the
--command option. In the man page documentation, it states specifically
Execute the argument to this option inside the terminal.
Execute the remainder of the command line inside the terminal.
In other words, it's probably not going to parse it in the way you think it should. Using
--execute prevents you from passing any further options to
An excerpt from one of my own scripts where I run multiple commands in separate tabs (names changed for my privacy/security):
gnome-terminal --tab --command="ssh cjohnson@GLaDOS" --tab --command="ssh drattman@GLaDOS"
(Incidentally, trying to use the
--command flag with
home will also result in the familiar "No such file or directory" error.)
I hope this isn't too long. I'm just trying to be thorough.