# Add a path to $PATH?



## angelkiller (Jul 5, 2009)

This is probably a simple question. I'm trying to install something. Here are the instructions that I'm having trouble with.

```
1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
        $ cd ~
        $ mkdir bin
        $ echo $PATH
```

Well, when I run the last command, I get:

```
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
```
But I don't understand what that means.

I just need for ~/bin to be in the $PATH file. This is all on Ubuntu 9.04. Any help would be awesome. Thanks.


----------



## Easy Rhino (Jul 6, 2009)

angelkiller said:


> This is probably a simple question. I'm trying to install something. Here are the instructions that I'm having trouble with.
> 
> ```
> 1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
> ...



hrm...well the echo command just echoes the dir path you are in. i dont know if it actually does anything as far installing software. i may be wrong tho.


----------



## angelkiller (Jul 6, 2009)

Easy Rhino said:


> hrm...well the echo command just echoes the dir path you are in. i dont know if it actually does anything as far installing software. i may be wrong tho.


Yeah, I think you're right. I think the purpose of the echo command was to check if ~/bin was in the $PATH file. My problem is that I can't decipher the output and I don't know how to add ~/bin to the $PATH file.

Just for clarification, the snippet of instructions I gave is just a few steps in the installation process. Nothing is actually supposed to be installed with those steps.

Thanks for the reply.


----------



## Easy Rhino (Jul 6, 2009)

angelkiller said:


> Yeah, I think you're right. I think the purpose of the echo command was to check if ~/bin was in the $PATH file. My problem is that I can't decipher the output and I don't know how to add ~/bin to the $PATH file.
> 
> Just for clarification, the snippet of instructions I gave is just a few steps in the installation process. Nothing is actually supposed to be installed with those steps.
> 
> Thanks for the reply.



what exactly do you need to decipher about that path line? also, what are you installing? perhaps i can help.


----------



## angelkiller (Jul 6, 2009)

Easy Rhino said:


> what exactly do you need to decipher about that path line? also, what are you installing? perhaps i can help.


Ok, after seeing this thread about Android on a PC, I thought I'd give it a try. After following a string of links, I ended up at this page. I got stuck in the 'Installing Repo' section.

I don't understand what the echo $PATH command is saying. Is it giving me a list of directories seperated by colans? Or is it saying something else. The format of the output confuses me.

And I've found a workaround. Adding a directory to the $PATH file lets you call files in that directory without typing the whole location. For example, I'd be able to type 'repo' to use Repo instead of '~/bin/repo'. And actually, that's the workaround. Because ~/bin is not in my $PATH file, I have to call repo manually. Minor inconvenience, but at least it works.

For anyone who cares about the results of me trying Android, I got stuck again. They say you need 1.5GB of RAM in order to compile it. Well, the machine I was using only had 512MB. My main Linux machine (my laptop) only has 1GB and I haven't gotten around to installing Linux on my powerful desktop with 4GB of RAM. So later today I'm gonna boot a live CD and try it again on my desktop. I'll make a thread about it if I get it to work...


----------



## Easy Rhino (Jul 6, 2009)

yea i wouldnt have a clue about how android works. do you install it over linux or entirely on its own?


----------



## ZenZimZaliben (Jul 6, 2009)

Are you looking for the pathing to be Pre or Past? Also you need to understand what the full path is.

What that output is stating is that those values (directory paths) are included in your PATH statement. Meaning it can pull library files and other files from those directories without you having to write the full path everytime. Each path is seperated by ":"


----------



## angelkiller (Jul 6, 2009)

Easy Rhino said:


> yea i wouldnt have a clue about how android works. do you install it over linux or entirely on its own?


TBH, I have no idea. I'm just following the instructions. I have no clue what I'm going to get in the end. 



ZenZimZaliben said:


> Are you looking for the pathing to be Pre or Past? Also you need to understand what the full path is.


I don't know what you're asking. Sorry.


ZenZimZaliben said:


> What that output is stating is that those values (directory paths) are included in your PATH statement. Meaning it can pull library files and other files from those directories without you having to write the full path everytime. Each path is seperated by ":"


Ok, that makes sense now. By chance do you know how to add ~/bin to that list? Or do I have to first answer your fist question?

Thanks.


----------



## ZenZimZaliben (Jul 6, 2009)

":/usr/local/bin" ":/usr/bin:"

It is already in the path. Assuming /usr is your home directory.


----------



## oily_17 (Jul 6, 2009)

To add ~/bin to $PATH try this -



> You need then to edit the “.bashrc” file which is a hidden file in your home folder. You would therefore first need to make Ubuntu show your hidden files. In the menu bar on the top of the file browser window, select “View/Show Hidden Files” and check the mark .
> 
> Then find the file “.bashrc” file and open it with the text editor. You would then need to append a line or two to the file. For example, if you would like to add the path~/bin, you would need to add the following line to the file:
> 
> PATH=~/bin:”${PATH}”



EDIT: Source


----------

