Jump to content

putting a directory in my path


Recommended Posts

Hi,

 

I decided to put some applications I installed myself into a directory /home/darkelve/bin/

 

Now I want to put it in my path so that they will be picked up when I type them from the command line or through Alt+F2.

 

But I forgot how to do it... sad.gif

 

I remember putting something in .bashrc or typing some kind of command (transport or something?)

Link to comment
Share on other sites

Hi,

 

I found about .bashrc

 

What I did was:

1. go to my home dir

2. login as root

3. add "export PATH=~/bin" in .bashrc with vim

4. ran "export PATH" from command line

 

The program names like 'azureus' and 'limewire' (which are in subfolders of /home/wouter/bin) get autocompleted now, but now bash says:

bash: azureus: command not found

 

Any ideas?

Edited by Darkelve
Link to comment
Share on other sites

Hi again... :o

 

as some as you probably already figured out, I put myself in quite a mess doing these last steps. Somehow Linux could not find any more commands unless I specified the complete path to the application. :wall:

 

I solved it though by removing the line from .bashrc ...

 

now I would really appreciate if someone could explain what happened and what's the right way to do it instead...

Link to comment
Share on other sites

/home/darkelve/bin should be in you PATH.

 

/home/darkelve/bin/folder is not in your PATH.

 

So just link the app/binary to /home/darkelve/bin (ln -s /home/darkelve/bin/folder/azureus /home/darkelve/bin/azureus and it should work.

 

Good luck

Edited by devries
Link to comment
Share on other sites

/home/darkelve/bin should be in you PATH.

 

/home/darkelve/bin/folder is not in your PATH.

 

So just link the app/binary to  /home/darkelve/bin (ln -s /home/darkelve/bin/folder/azureus /home/darkelve/bin/azureus and it should work.

 

Good luck

 

Thank you, I got that!

 

But why were none of my other commands, like "find" found when I did not type the full path (/usr/sbin/find or something)?

 

And I don't know if this is related, but at the login screen (I think KDM) whatever Window Manager I would choose would bring up KDE??

Edited by Darkelve
Link to comment
Share on other sites

if you do

export  PATH=/somedir

then only that directory is on your path and so nothing in /usr/bin or wherever will be found.

 

If you do

export PATH=$PATH:/somedir

then the new entry is simply added to your existing path and all will be found again...

Link to comment
Share on other sites

Thanks phunni, that makes sense!

 

Still leaves the KDE question though... gonna try and see if I can login into another WM now.

 

Update: well, since I am typing this in WindowMaker now seems to suggest everything is okay now... maybe KDM (I think, or maybe XDM) when it cannot find the other Window Managers it starts KDE by default... or something?

 

 

Darkelve

P.S. mods can mark this as solved now ...

Edited by Darkelve
Link to comment
Share on other sites

Hi,

 

I decided to put some applications I installed myself into a directory /home/darkelve/bin/

 

Now I want to put it in my path so that they will be picked up when I type them from the command line or through Alt+F2.

 

But I forgot how to do it... sad.gif

 

I remember putting something in .bashrc or typing some kind of command (transport or something?)

If you put them in /usr/local/bin you can just type the command or script ./ and thats it, they will open/execute. This will make them system wide executable.

You may need to chmod +rx whatever though.

Link to comment
Share on other sites

Hi,

 

I decided to put some applications I installed myself into a directory /home/darkelve/bin/

 

Now I want to put it in my path so that they will be picked up when I type them from the command line or through Alt+F2.

 

But I forgot how to do it... sad.gif

 

I remember putting something in .bashrc or typing some kind of command (transport or something?)

If you put them in /usr/local/bin you can just type the command or script ./ and thats it, they will open/execute. This will make them system wide executable.

You may need to chmod +rx whatever though.

 

You mean the symlinks, or the actual programs themselves?

 

Also, I noticed on my system there's nothing there. What's this directory for exactly? For me to put progams in?

Edited by Darkelve
Link to comment
Share on other sites

/usr/local is where most tarballs go if ./configure is not give the --prefix=/usr. It's also where source, tarbal, tgz distros install apps where rpm distros go to /usr.

 

So on an rpm based distro yes, /usr/local is the perfect place for other versions of say kde, gnome or anything you want to compile from source. Then you can keep your app that was installed by rpm.

 

/usr/local is in your $PATH by default.

[root@localhost root]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin[root@localhost root]#

:D

:unsure: anon? code is messed up :unsure:

 

You can easily add a path by modifying ~/.bashrc. Say you wanted to add

/home/Darkdelve/apps/bin

Change

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin

To

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/home/Darkdelve/apps/bin

 

then in a terminal do;

bash

or logout and back it. Also check out the

printenv

output for kicks, if you want.

Edited by bvc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...