Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-10-2005, 03:22 PM   #1
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Rep: Reputation: 16
change default bash directory in gnome-terminal

Does anyone know how to change the default directory that I start in when I launch a terminal? I'm would like to immediately start in /home/user/Desktop, so I don't have to cd Desktop nearly every time I open a console.

I don't mind if this only affects me in gnome, or if it's system-wide.

Thanks in advance
Old 02-10-2005, 03:29 PM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
you could always add a "cd" line to your .bash_profile:
cd Desktop
Old 02-10-2005, 03:40 PM   #3
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
i'm not in gnome right now, but can't you specify the working directory of panel icons? --if the terminal icon is a special one, why not rebuild it using a custom application link, and that should certantly give you the working directory option... this would limit the effect to terminals you open by clicking the icon on your panel in gnome... if it works at all...
Old 02-10-2005, 03:48 PM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
The ~/.bash_profile only runs when starting a login shell. You can use ~/.bashrc instead. (Although perhaps the ~/bash_profile's cwd will carry though to the future, that would take experimenting to verify.)

If you start the shell graphically from the menu, or an icon on the task bar, look under properties, there is an entry for the starting directory. You can your initial Current Working Directory (cwd) there instead. As nearly always, there are many ways to do the same thing.

The info bash page describes what order that the startup scripts are looked at. Usually, one will source the other if it exists. For example, the global /etc/bash_profile if it exists may source (ie run in the same shell and not a subshell) your local ~/.profile. On my SuSE system, there is an /etc/profile rather than an /etc/bash_profile. However as the comments note, I'm supposed to make global changes in /etc/profile.local instead. Your best bet is to scan through the start up files, to familiarize yourself with how your specific distro does things.
Old 02-10-2005, 07:04 PM   #5
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
I put 'cd Desktop' into ~/.bashrc (which I had to make), and now whenever I use xterm or gnome-terminal, it defaults to my Desktop.

Thanks all
1 members found this post helpful.
Old 10-01-2009, 06:54 PM   #6
LQ Newbie
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Thank you ming0. Your post helped me do exactly the same thing!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gnome terminal, default browser? c_olin3404 Slackware 3 07-21-2012 10:36 PM
gnome-terminal default geometry dunric Linux - Software 1 11-09-2005 02:02 AM
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 03:49 PM
proftp default directory how to change??? bgriesi Mandriva 3 12-29-2004 12:13 PM
change default save directory canyon289 Linux - Software 1 10-24-2004 12:16 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration