1

When I press CtrlAltt, the terminal is open in $HOME dir.

I want to open it in /tmp instead.

Thus:

  • CtrlAltt
  • Terminal is open at /tmp

Is it possible?

How can I configure it?

muru
  • 197,895
  • 55
  • 485
  • 740

2 Answers2

2

By adding cd /tmp to your .bashrc, bash will go to /tmp directly after you open a Terminal.

  • Adding it to .bashrc may confuse some scripts. At a minimum, .bash_login would be better. – chrylis -cautiouslyoptimistic- Aug 16 '20 at 01:25
  • @chrylis-cautiouslyoptimistic- .bash_login shouldn't be used for this. The shell in a graphical terminal application (Ctrl+Alt+T) in Ubuntu--and just about any GNU/Linux system--isn't a login shell so none of .profile, .bash_profile, or .bash_login is sourced. Also, creating .bash_login (or .bash_profile) causes bash to source it instead of, rather than in addition to, .profile, for login shells (as one gets when logging in on a virtual console or via SSH). On Ubuntu, the default contents of .profile are substantial. cd /tmp in .bashrc is fairly safe if placed at the end. – Eliah Kagan Aug 16 '20 at 17:12
0

This will open a terminal at the /tmp directory.

$ mate-terminal --working-directory=/tmp/
fixit7
  • 3,127