Objective
I am looking for an easy way to consistently run a terminal that automatically opens to a specific directory. Is there a way to do that without changing the default directory?
Preferably I just click on a 'shortcut' link and it opens that customized terminal to that directory or maybe runs the CD command for me.
Full Story
Currently, when I open the terminal (via the Linux Mint GUI menu) it by default 'takes' me to the home directory. This is a fine default choice for the majority of times.
However, there are instances where I wish it would open elsewhere. I don't wish typing the CD command every time, for example:
cd Dropbox/GTD
Since I go to work on the files located on that specific directory every now and then (enough to be a pain), I am hoping someone can point a way so all I do is ideally
- Click on a desktop shortcut (script or whatever mechanism)
- Terminal opens under that specific directory without me typing any commands.
- I can instantly work on the files located there.
- If I open another terminal outside that 'shortcut', the terminal opens to the default home directory like usual.
I have a basic understanding working with the command line and Linux in general but am not advanced. Hopefully, you can dumb it down a bit ^_^
Oh and thanks in advance for any tidbits that can help point me in the right direction.
Best Answer
Most terminal programs like xterm, urxvt, gnome-terminal have an option to change the starting working directory of the shell.
If you are using gnome-terminal, there is a special command line switch you have to provide to start the shell in a user defined directory. The command line switch I'm talking about is
You should take a look at the manual pages of gnome-terminal to verify this.
So, if you want to make a desktop shortcut, the command you have to enter would be:
Beforehand feel free to test the command in your current terminal session.
For users on Linux Mint, follow these instructions
gnome-terminal --working-directory=XXX
. Make sure to replaceXXX
with the directory you want it to go to (see the example above)