linux fixes.docx
Transcript of linux fixes.docx
-
8/14/2019 linux fixes.docx
1/3
How to fix Command Not Found error inLinux?
Command Not Found is a most common error in Linux, it means that your system has searched for
the command everywhere but couldn't find it. Well, its not really everywhere, there are some specific
places where the system searches for the command. This is all done using the PATH environment
variable. Commands are scripts and binary executables. PATH environment variable contains paths
of various directories, where your system looks for these executables.
In order to take a look at the $PATH variable in your system, run the following command in a
terminal.
[chia]$echo $PATH
/usr/sbin:/usr/bin:/usr/local/bin:/bin:/sbin:/home/chia/bin
A typical $PATH should look something like above. The value can vary from distro to distro but its
more or less similar. As you can see it contains the directories where one can commonly find various
binary executables of installed softwares - /bin, /usr/bin, /sbin etc. So, when you actually run a
command on your system, the command is looked upon in all the directories mentioned in PATH
until a match occurs.
Find the path of your command
To check the path of your command type
[chia]$which COMMAND_NAME
[chia]$which vim
/usr/bin/vim
[chia]$which ls
/bin/ls
Command not found even on su?
You might have faced a command not found error even when you su as root and you know you have
that command in your bin directories for root. There is a difference between su and su -. When you
login as root without the dash. Your login path remains
-
8/14/2019 linux fixes.docx
2/3
-
8/14/2019 linux fixes.docx
3/3
This is not a supported way of doing things. Ubuntu does not have a root password by default.
If you need to accomplish something as root, enterCode:
sudo -i
in the terminal.
No worries, though. You can easily disable the root account again:
https://help.ubuntu.com/community/Ro...r root account
https://help.ubuntu.com/community/RootSudo#Re-disabling%20your%20root%20accounthttps://help.ubuntu.com/community/RootSudo#Re-disabling%20your%20root%20accounthttps://help.ubuntu.com/community/RootSudo#Re-disabling%20your%20root%20account