Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-06-2004, 03:04 AM   #1
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210

Rep: Reputation: 30
how to make a file that will open specific things for you

how would i go about making a file that would open up a certain directory instead of me typing cd "directory" everytime i want to use that program?

-thanks in advance
Old 11-06-2004, 03:10 AM   #2
Registered: Sep 2004
Distribution: Slackware 13; openSUSE 11.2
Posts: 255

Rep: Reputation: 34
You can create a script file that would do that for you.. Let's call this file


cd /go/to/this/directory

That's it! Put whatever directory in that you want after the cd.
After you create this file, do this command:

chmod +x gothere

And if you want it to be available no matter what directory you are currently in, do something like this:

cp gothere /usr/bin/gothere
Old 11-06-2004, 07:04 AM   #3
Senior Member
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
Or you could use your shell alias function, like in Bash :
alias myprogram="cd /path/to/your/directory; ./myprogram"

then you just type :
to access the directory and execute 'myprogram' from here


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
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
How to make a specific command(s) work in a specific shell only naren_0101bits Linux - Newbie 3 08-28-2005 01:24 PM
I cannot make rox open a +x file as normal files codec Linux - Software 1 05-02-2004 06:04 AM
How to open or make a .php file in emacs?? eye Linux - Software 1 12-02-2003 12:19 AM
best book for learning general things about (not specific topic) redhat 9.0 chinmay nautiya Linux - Software 6 07-03-2003 01:02 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration