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.
PATH="/sbin:$PATH"
to the end of your~/.profile
file. – terdon Jan 28 '21 at 19:16~/.profile
in a text editor (create it if it doesn't exist) and add a line withPATH="/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# 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"
fi
– gardenair Jan 29 '21 at 11:29~/.profile
, a line with PATH="/sbin:$PATH"`, save the file and log out. – terdon Jan 29 '21 at 11:31