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?
export PATH=${PATH}:/sbin
sh 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).
echo $SHELL
to find out which shell you're using, and run the appropriate commands (I'm guessing tcsh/csh since you don't have export
). I've updated this answer with syntax for all three.
echo $SHELL
to find out which shell you're using.zsh
syntax, see Adding a new entry to the PATH variable in ZSH