• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Add a path to $PATH?

Joined
May 16, 2008
Messages
1,258 (0.22/day)
Location
North Carolina
This is probably a simple question. I'm trying to install something. Here are the instructions that I'm having trouble with.
Code:
   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:
Code:
/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

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,444 (2.43/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
This is probably a simple question. I'm trying to install something. Here are the instructions that I'm having trouble with.
Code:
   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:
Code:
/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. :)

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.
 
Joined
May 16, 2008
Messages
1,258 (0.22/day)
Location
North Carolina
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

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,444 (2.43/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
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.
 
Joined
May 16, 2008
Messages
1,258 (0.22/day)
Location
North Carolina
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

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,444 (2.43/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
yea i wouldnt have a clue about how android works. do you install it over linux or entirely on its own?
 
Joined
Mar 4, 2005
Messages
3,612 (0.52/day)
System Name TheReactor / HTPC
Processor AMD 7800x3d 5050Mhz / Intel 10700kf (5.1ghz All Core)
Motherboard ASrock x670e Taichi / ROG Strix z490-e gaming
Cooling HeatKiller VI CPU/GPU Block -2xBlackIce GTX 360 Radiators - Swiftech MCP655 Pump
Memory 32GB G.Skill 6000Mhz DDR5 / 32GB G.Skill 3400Mhz DDR4
Video Card(s) Nvidia 3090ti / Nvidia 2080ti
Storage Crucial T700 2TB Gen 5 / Samsung Evo 2Tb
Display(s) Acer Predator xb271hu - 2560x1440 @144hz
Case Corsiar 550
Audio Device(s) on board
Power Supply Antec Quattro 1000W
Mouse Logitech G502
Keyboard Corsair Gaming k70
Software Windows 10 Pro 64bit
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 ":"
 
Joined
May 16, 2008
Messages
1,258 (0.22/day)
Location
North Carolina
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. :cool:

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.
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.
 
Joined
Mar 4, 2005
Messages
3,612 (0.52/day)
System Name TheReactor / HTPC
Processor AMD 7800x3d 5050Mhz / Intel 10700kf (5.1ghz All Core)
Motherboard ASrock x670e Taichi / ROG Strix z490-e gaming
Cooling HeatKiller VI CPU/GPU Block -2xBlackIce GTX 360 Radiators - Swiftech MCP655 Pump
Memory 32GB G.Skill 6000Mhz DDR5 / 32GB G.Skill 3400Mhz DDR4
Video Card(s) Nvidia 3090ti / Nvidia 2080ti
Storage Crucial T700 2TB Gen 5 / Samsung Evo 2Tb
Display(s) Acer Predator xb271hu - 2560x1440 @144hz
Case Corsiar 550
Audio Device(s) on board
Power Supply Antec Quattro 1000W
Mouse Logitech G502
Keyboard Corsair Gaming k70
Software Windows 10 Pro 64bit
":/usr/local/bin" ":/usr/bin:"

It is already in the path. Assuming /usr is your home directory.
 
Joined
Sep 25, 2006
Messages
2,312 (0.36/day)
Location
Norn Iron
Processor Q9550 @3.8
Motherboard Asus Maximus Extreme
Cooling Custom water cooling
Memory 4GB Patriot Viper DDR3 1600MHz
Video Card(s) 2x HD4870 512MB
Storage 2x 500GB
Display(s) 3x LG L226WTQ 22" Widescreen LCD
Case Modded TJ07
Audio Device(s) On board
Power Supply PC P&C Silencer 750
Software Windows 7 Ultimate
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
 
Top