LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Run user command on Terminal startup (https://www.linuxquestions.org/questions/linux-general-1/run-user-command-on-terminal-startup-235007/)

coolfrog 09-25-2004 03:10 AM

Run user command on Terminal startup
 
Hi,
I want to automatically 'cd' into a particular drive whenever i start terminal. How do i get this done ? Do i have to do scripting ?

Boffy 09-25-2004 04:35 AM

If you are using KDE then create a script called "shell.sh" - or whatever you want really ending in .sh. Then put the following lines in:
Code:

#!/bin/bash         
konsole --workdir /home/

Replace /home/ with the directory you want to go to.

Change the permissions of the file (right click and go to properties) to make it executable.

Then whenever you click on that you will open the konsole to that directory.

Boffy

coolfrog 09-25-2004 07:00 AM

Thanx. You've made my life much easier.

coolfrog 09-26-2004 01:28 AM

What should i do if i use Gnome ?

Boffy 09-26-2004 09:08 AM

Well as long as you have KDE on the machine it will work fine as it is.
If not try:
Code:

#!/bin/bash
gnome-terminal --working-directory=DIRNAME

Good Luck

Boffy


All times are GMT -5. The time now is 01:32 PM.