I know many people have asked about environment variables before, but I am having a hard time dealing with these paths while ensuring I don't mess around with the original settings. How would you go about executing these commands in Ubuntu in terms of environment variables? Thanks in advance!

Please put /home/stanley/Downloads/ns-allinone-2.34/bin:/home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/stanley/Downloads/ns-allinone-2.34/tk8.4.18/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.


(1) You MUST put /home/stanley/Downloads/ns-allinone-2.34/otcl-1.13, /home/stanley/Downloads/ns-allinone-2.34/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH=

(2) You MUST put /home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.

  • 1
    If you simply use the export command the env variables will reset to normal when you reset your computer.
    – Nick
    Jun 2, 2010 at 7:24

1 Answer 1


If you're using sh based shells, one of which seems to be default in ubuntu, type the following commands and you'll be fine:

export PATH=/home/stanley/Downloads/ns-allinone-2.34/bin:/home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/stanley/Downloads/ns-allinone-2.34/tk8.4.18/unix:$PATH

export LD_LIBRARY_PATH=<Path to X libraries>

export TCL_LIBRARY=/home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/library

None of these is persistent, and will be lost as soon as you close the terminal. So you'll have to enter them again. You can add them to your .bashrc/.bash_profile/.profile if you want them to be persistent.

  • I couldn't find .bashrc folder on my profile on Ubuntu. Where is it?
    – stanigator
    Jun 2, 2010 at 17:14
  • Its a file in your home folder. If you open terminal and type ls $HOME/.bashrc, you'll see it. Or you could show hidden files in the nautilus and double click on .bashrc in your home folder. All this is assuming that it already exists. If it doesn't, try with the other files I mentioned.
    – 0fnt
    Jun 3, 2010 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .