symbolic link to /opt

7,239

Yes. To make commands available in PATH, you can either

a) Add the directory to your PATH variable by putting something like the following line in /etc/profile (systemwide) or ~/.profile (your user)

PATH=/opt/ActiveTcl-8.4/bin:$PATH

b) Add symbolic links to the commands in a directory already in PATH (echo "$PATH")

sudo ln -s /opt/ActiveTcl-8.4/bin/* /usr/local/bin

Note that with method (a), the changes will not take effect until next log in.

Share:
7,239

Related videos on Youtube

Alexey Ce
Author by

Alexey Ce

Updated on September 18, 2022

Comments

  • Alexey Ce
    Alexey Ce almost 2 years

    How do you :

    "Create as administrator (sudo) one link in /usr/bin to the command that you'd like to call (for example with8.5 and tclsh8.5). One time that you had create the links you can run directly tclsh8.5 or wish8.5 in one terminal."

    http://community.activestate.com/node/7489

    Does that mean to link to the particular binary from the /opt directory?

    • NZ Dev
      NZ Dev over 4 years
      I cam here looking for how to create a sym link to opt. not really what I found :(
  • Michał Šrajer
    Michał Šrajer over 12 years
    to define systemwide environment it is better to set edit /etc/environment file. Anyhow, /etc/profile will work too for interactive commands.
  • geirha
    geirha over 12 years
    @MichałŠrajer Yes, could've used /etc/environment (or ~/.pam_environment) too, but either will work equally well for this case, since both files are evaluated during login.
  • Michał Šrajer
    Michał Šrajer over 12 years
    Agree. Your answer was correct. (+1) I just wanted to mention about some convention which is good to follow, and some people might not be aware of.
  • Alexey Ce
    Alexey Ce over 12 years
    I was specifically asking about option b, not about /etc/environment.