Forum Home
Press F1
 
Thread ID: 16191 2002-03-01 03:56:00 How do you set path directories in Linux? Guest (0) Press F1
Post ID Timestamp Content User
37511 2002-03-01 03:56:00 I want to run a program from a particular directory.

So far I have to either type the full directory or change to that directory and run it from there. I know in dos you just set the paths.

How do I do this?

Thanks in advance.
Guest (0)
37512 2002-03-01 04:22:00 In Linux you just set the path. :<)

Since you are the only user (apart from root), you might as well set the global PATH in one of the /etc. Again, I can never remember which file ... In a terminal window, 'su -', 'cd /etc', 'grep PATH *'. That will tell you the files to look at: probably profile, bashrc. Then you can edit the files which have lines starting 'set PATH ' to include the directories you need. The directory names are separated by ':' (DOS copied that) If the line gets too long you can wrap it or end it and add a line 'set PATH=blah:blah:$PATH$ as you would in DOS..

logout of the su, logout of your session, and login. You can see your path by 'echo $PATH' (all your environment variables by 'set | more').

You can set many things like that either in /etc for 'everyone' in home directories in 'dot files' (names like '.bashrc' which are not visible in ls directory listings unless the '-l' option is used).
Guest (0)
1