Can I set terminals' default directory to each different ones?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can I set terminals' default directory to each different ones?
I have 3 terminals on my Debian wheezy.
they are Gnome Terminal, Terminator and Guake.
Can I set their default directory to each different ones.
Eg:
I want to set Gnome Terminal's default directory to ~/Desktop ,
Terminator default directory to ~/Download and
Guake's default directory to ~/mybin .
Do you mean that when you open a different type of terminal, you should get a different directory by default? Well, opening a different directory depends upon the logged in user, not on type of terminal. Let's say that if you have logged in as 'foo' user, then by default it will open '/home/foo' directory or the directory you've set as home directory for 'foo' user irrespective of terminal type.
Most, if not all, gui console programs have some option available for specifying the default starting directory. The more feature-rich ones like konsole even have options for multiple profiles that can be individually configured.
Start digging into the options and documentation for the programs you're using.
And even if they don't you can still do it by using a wrapper script to set the working directory before exec of the application.
Something simple like:
Code:
#!/bin/sh
cd $1
shift # to discard the first parameter (the new working directory)
exec $* # use any remaining parameters as the application to run + parameters
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.