Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As a title, or in other words is possible assign in bash launcher a custom .bashrc?

share|improve this question
up vote 4 down vote accepted

You can pass the --title argument to gnome-terminal, though it will likely get overwritten. You can also use --working-directory to specify a specific path that the new terminal is opened to. And finally, you can use the --command option to specify what command to run. Like so:

gnome-terminal --command "bash --rcfile ~/.bashrc-special"
share|improve this answer
Another option is gnome-terminal -x bash -c 'cd /whatever/path; exec bash' which avoids the need for a separate bashrc. Yet another option, which applies specifically to gnome-terminal, is that if you open a gnome-terminal (the "usual" way) and hit Ctrl+Shift+N, a new terminal is opened, with the cwd set to the same as the current gnome-terminal's shell has. – geirha Mar 28 '12 at 19:21
@geirha Yes, but that is a very complicated way to just do gnome-terminal --working-directory /whatever/path. :) – dobey Mar 28 '12 at 19:23
aye, but it can be applied to most terminal emulators, e.g. with uxterm: uxterm -e 'cd /whatever/path; exec bash'. I agree with your answer. I merely intended to expand on it. – geirha Mar 28 '12 at 19:25
Hi, thanks for answer... little problem: have used the original gnome-terminal.desktop file for my launcher and have changed in this:TryExec=gnome-terminal --working-directory "~/Works" Exec=gnome-terminal --working-directory "~/Works" but don't work...where have to add the argument? – byterussian Mar 28 '12 at 19:30
@Angelbit, in the shell, ~ gets replaced with your home directory (or more correctly, the value of the HOME environment variable). The Exec=-line in a .desktop file is not interpreted by a shell, and does not replace ~ with the value of HOME. Variable expansions on the Exec=-line are honored though, so Exec=gnome-terminal --working-directory "$HOME/Works" should work. – geirha Mar 28 '12 at 19:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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