2016年8月2日 星期二

How to create a soft or symbolic link?

Q:
I am installing p4v in /opt, but /usr/bin is on my path. Is it possible to create a soft or symbolic link for p4v from /opt to /usr/bin, so I can just type "p4v" since /usr/bin is in my path?

A:

  1. ln -s /<full>/<path>/<to>/<file> /usr/local/bin
  2. It would be a better way as below:
    echo "export PATH=\$PATH:/opt/bin" >> ~/.bashrc
    . ~/.bashrc