Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
You may check here for a discussion on the topic (ie pros and cons). –  new123456 Apr 16 '11 at 1:52
add comment

2 Answers

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
add comment

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
1  
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
add comment

Your Answer

 
discard

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.