![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
|
|
Desktop Environments Support for your Ubuntu desktop. Including Gnome, KDE and XFCE. |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2006
Beans: 48
|
Adding bash commands
So, I how would I add a command, where i just open terminal and type, for example
program and it launches a program called program. I searched, but didnt know exactly what to put, or even how to explain this to people in this thread.. so, hopefully someone can help. |
|
|
|
|
|
#2 |
|
Run, little guy, run...
![]() Join Date: Oct 2005
Location: Jacksonville, FL
Beans: 29,273
Ubuntu 9.10 Karmic Koala
|
Re: Adding bash commands
Do you mean how can you run a program from a terminal? Click Applications, Accessories, then Terminal. Then, at the prompt, type
Code:
firefox
__________________
In the world of Linux, who needs Windows and Gates... Got most of my golden beans at an auction on eBay (with a couple of free drinks). |
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2006
Beans: 48
|
Re: Adding bash commands
No, I mean, how do I add a new application which can be launched from terminal by merely typing "blahblah" or whatever it might be?
For instance, I have an executable that I want to be able to launch by merely typing a word into terminal. Also, I don't know why/how I posted this here, can a mod move it to general help? Thanks. Last edited by Gorbachev; March 15th, 2007 at 11:17 PM.. |
|
|
|
|
|
#4 |
|
Dark Roasted Ubuntu
![]() Join Date: Oct 2006
Location: Tucson, AZ
Beans: 1,088
Xubuntu 9.10 Karmic Koala
|
Re: Adding bash commands
What you need to do either put the executable in a directory that's in your PATH, or add the directory that the executable is in to you PATH.
In a terminal window, type "env | grep PATH", and you'll see a line like: Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/lloyd/bin: Alternately, you can add new directories onto that path. Note the last directory in the PATH listed above: "/home/lloyd/bin". This is a directory I've set up for my "private" executables. To add this to my PATH, I edited the file ".bashrc", and added the following line Code:
export PATH=$PATH:/home/lloyd/bin: Finally, if you include the full path to an executable, you can run it regardless of where it it: Code:
/home/lloyd/test/someprog Lloyd B.
__________________
Don't tell me to get a life. I had one once. It sucked. |
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2006
Beans: 48
|
Re: Adding bash commands
Ah, thank you ever so kindly! Very thorough answer.
Thank you! Edit: Now, how would I remove a directory? Thanks again. Last edited by Gorbachev; March 16th, 2007 at 02:46 AM.. |
|
|
|
|
|
#6 | |
|
Dark Roasted Ubuntu
![]() Join Date: Oct 2006
Location: Tucson, AZ
Beans: 1,088
Xubuntu 9.10 Karmic Koala
|
Re: Adding bash commands
Quote:
If you mean removing a directory that the system had placed in the PATH - you have to replace the entire PATH. For example: Code:
export PATH=$PATH:/home/lloyd/bin: Code:
export PATH=/bin:/usr/bin:/usr/local/bin:/home/lloyd/bin Be cautious with removing the directories that the system placed in your path. If you remove, for example, "/bin", you'll find that the some common commands (such as "ls") no longer work. A useful hint: to find out which directory a command is in, type "which {command}" in a terminal window. Lloyd B.
__________________
Don't tell me to get a life. I had one once. It sucked. |
|
|
|
|
|
|
#7 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2006
Beans: 48
|
Re: Adding bash commands
Well, bash is still looking for a directory which no longer exists (the old location of Wolfenstein ET) and, even though the new location is added, terminal keeps saying file not found directory doesnt exist (something similar to that) everytime i type "et" terminal. if I type et.x86, it launches fine, though.
|
|
|
|
|
|
#8 | |
|
Dark Roasted Ubuntu
![]() Join Date: Oct 2006
Location: Tucson, AZ
Beans: 1,088
Xubuntu 9.10 Karmic Koala
|
Re: Adding bash commands
Quote:
1. Read through the entire .bashrc. That is the most likely place for such a change to have been made. 2. Look in your home directory for a file called ".profile". If one is found, check it to see if it's adding that PATH. 3. Check the file "/etc/bash.bashrc". Note: it's owned by root, so you'll need a "sudo" or a "gksudo" to edit it. 4. Check the file "/etc/profile". Same note as #3. Lloyd B.
__________________
Don't tell me to get a life. I had one once. It sucked. |
|
|
|
|
|
|
#9 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2006
Beans: 48
|
Re: Adding bash commands
Hmm, neither make mention of even $PATH or PATH, or the directory which no longer exists, bizarre.
![]() |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|