LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-25-2004, 03:10 AM   #1
coolfrog
Member
 
Registered: Sep 2004
Location: India
Distribution: Slackware 10.0
Posts: 77

Rep: Reputation: 15
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 ?
 
Old 09-25-2004, 04:35 AM   #2
Boffy
Member
 
Registered: Jul 2003
Location: Durham, UK
Distribution: Ubuntu 8.04
Posts: 419

Rep: Reputation: 30
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
 
Old 09-25-2004, 07:00 AM   #3
coolfrog
Member
 
Registered: Sep 2004
Location: India
Distribution: Slackware 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Thanx. You've made my life much easier.
 
Old 09-26-2004, 01:28 AM   #4
coolfrog
Member
 
Registered: Sep 2004
Location: India
Distribution: Slackware 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
What should i do if i use Gnome ?
 
Old 09-26-2004, 09:08 AM   #5
Boffy
Member
 
Registered: Jul 2003
Location: Durham, UK
Distribution: Ubuntu 8.04
Posts: 419

Rep: Reputation: 30
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
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run command in new gnome-terminal checkchan Linux - General 10 08-29-2012 03:55 AM
Is there a terminal command that I can run that will........... ludwig W Linux - Networking 20 11-28-2005 03:59 PM
gnome-terminal command line startup fredgarvin Red Hat 2 09-16-2004 10:39 PM
make a command run at startup? cheater1034 Linux - General 2 09-12-2004 05:51 AM
start terminal & run command automatically peeples Linux - General 2 09-08-2003 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:28 AM.

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