0

I am using Debian 10 on my laptop. I am facing an error message:

# fdisk -l
bash: fdisk: command not found

My path is:

test@debian:/sbin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games</code>

If I set my $PATH to:

test@debian:/$ PATH="/sbin:$PATH"

I then get:

test@debian:/$ echo $PATH
/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

After that my fdisk -l command executes perfectly. The problem is that every time I reboot my laptop, I have to set the path again. I want to add it permanently.

Please guide me on which file may I choose to edit for permanent changes and what should I add inside it.

terdon
  • 242,166
  • Please see the answers to the duplicate. Basically, you just add PATH="/sbin:$PATH" to the end of your ~/.profile file. – terdon Jan 28 '21 at 19:16
  • Please guide me the exact file and the location in which I may add my path . In the answer still it is not clear. test@debian:/$ PATH="/sbin:$PATH" – gardenair Jan 29 '21 at 07:28
  • Just open the file ~/.profile in a text editor (create it if it doesn't exist) and add a line with PATH="/sbin:$PATH" to that file. Save the file, log out, log back in and it should be ready. – terdon Jan 29 '21 at 09:21
  • I try to follow the instructions but failed. # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi

    set PATH so it includes user's private bin if it exists

    if [ -d "$HOME/bin" ] ; then

    PATH="$HOME/bin:$PATH";PATH="/sbin:$PATH"

        PATH="/sbin:$PATH"
    

    fi

    – gardenair Jan 29 '21 at 11:29
  • Please just do as I suggested. Just open the file ~/.profile, a line with PATH="/sbin:$PATH"`, save the file and log out. – terdon Jan 29 '21 at 11:31

0 Answers0