-2

I need to add commands found in /usr/bin to my root/home directory search path because I recently formatted my dell inspiron amd64 bit with Debian 9 stretch. I only installed the core os without any additional software. So now, each time I tried running sudo on my home directory or if I try running any commands on my root account, I keep getting an error message that such commands cannot be found. From my little research online , I have come to know that I need to add those commands to either my home or root search path.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

3

To see your path type:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin

To append /usr/bin to your path immediately, type:

$ PATH="$PATH:/usr/bin"

To make sure /usr/bin remains in your path after next login, add(or edit) the PATH variable to your rc file (in my case .bashrc):

Check shell:

$ echo $SHELL
/bin/bash

My shell is bash, so I edit my .bashrc file:

vi ~/.bashrc

Add the following line (or edit the PATH line if it already exists):

PATH="$PATH:/usr/bin"
L.Ray
  • 469