I am using a default installation of FreeBSD, with the C shell (csh).
Suppose I have a command I can run by executing this: /sbin/abc, but cannot run by executing abc. How can I set certain path or something that make abc runnable everywhere?
2 Answers
Aha, FreeBSD. That's tcsh, I believe.
So:
set path=(/sbin $path) 0 export PATH=${PATH}:/sbinsh syntax (two separate commands):
PATH=${PATH}:/sbin
export PATH
setenv PATH "${PATH}:/sbin"
set path=($path /sbin)
This will append /sbin to your path, so when you type abc, the shell will also look in /sbin for it. You can also add the command to your ~/.bashrc file (or ~/.cshrc, ~/.tcshrc, ~/.profile, ~/.login—depending on which shell you use).