Super User is a question and answer site for computer enthusiasts and power users. 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

I keep all of my web design work under /var/www/(application_name). Nine times out ten, when I open a terminal, I'm heading to the www folder - cd /var/www. I would love to make that my "home" folder for the terminal, so it would just open there - I know if I ctrl+shift+t to open a new tab it defaults to the same dir, but it would be nice to have the first opened terminal default to there. Is this possible, or is there a better way to go about this?

share|improve this question
You may check here for a discussion on the topic (ie pros and cons). – new123456 Apr 16 '11 at 1:52
up vote 1 down vote accepted

How do you start your application?

  • Menu
  • Icon in Panel
  • Icon in Desktop
  • something else (which?)

I'm using xUbuntu, and with german translation, so you have to be flexible in adopting this solution for the panel:

  • right click on panel
  • add new element
  • choose 'new starter'
  • for xubuntu, name, description program: xfterm4 - yours might be 'gterm' or 'xterm' or 'gnome-terminal'
  • choose a different terminal icon than that for $HOME
  • choose 'working directory': '/var/www'
  • done

I guess for a starter icon on the desktop, the way is similar. For Menu-entries consult your administrator. :) Maybe similar too.

share|improve this answer
I use Docky to start my apps normally. But adding a new application to my Applications menu for gnome-terminal --working-directory /var/www/ was perfect. Just dragged it to Docky and now I'm all set. Thanks! – d3vkit Apr 25 '11 at 17:42

I don't run Ubuntu specifically, but here's two things I know you can do in a *NIX environment off the top of my head:

Change your home directory in /etc/passwd:

$ usermod -d MY_NEW_HOME_DIR `whoami`

Always cd in your shell configuration (e.g. bashrc):

$ echo 'cd MY_FAVORITE_DIR' >> ~/.bashrc

To be honest I think either of these might produce nasty consequences. If I had to pick one, I would pick the later (i.e. shell config). Your home directory can be referenced by many things, and it might be a bad idea to be arbitrarily changing that. The .bashrc file is only supposed to be sourced on interactive logins, so it should be ok, but in practice, it can be difficult to determine when it is actually sourced.

share|improve this answer
Yeah - changing your home directory just to change startup is a bit bad. Consider the amount of hidden .* files under $HOME - all that would be reset under the new $HOME. – new123456 Apr 16 '11 at 1:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .