![linux命令找不到命令](https://img-blog.csdnimg.cn/img_convert/120a204a158fd2f07e4ca5fc2df3cad1.png)
linux命令找不到命令
A common problem for system administrators or daily Linux users is “command not found” error. There are different causes of this problem. We can troubleshoot this problem in several ways.
对于系统管理员或日常Linux用户而言,常见问题是“找不到命令”错误。 有此问题的不同原因。 我们可以通过几种方式解决此问题。
错误拼写错误 (Misspell Error)
Misspelling is number one problem especially novice users or beginners. Here is an example we will try to run nmap command but we will misspell namp like below.
拼写错误是头号问题,尤其是新手用户或初学者。 这是一个示例,我们将尝试运行nmap命令,但将如下所示拼写namp。
$ namp
![Misspell Error](https://img-blog.csdnimg.cn/img_convert/f0c8a714a9e9bf959c16ecdb04884f73.png)
In this example, we try to run Nmap but misspelled it. Ubuntu provides some help by listing suggestion about the correct command.
在此示例中,我们尝试运行Nmap但拼写错误。 Ubuntu通过列出有关正确命令的建议来提供一些帮助。
路径不正确 (Path Is Not Correct)
Path is used to specify commands locations. If command location is not specified in PATH environment variable we can get an error like “The command could not be located”
路径用于指定命令位置。 如果未在PATH环境变量中指定命令位置,则会出现类似“找不到命令”的错误
$ zip
![](https://img-blog.csdnimg.cn/img_convert/1739d15e5f2737c9bc8e853158c955bd.png)
We can solve this by adding /usr/bin
to the PATH environment variable and export it like below.
我们可以通过将/usr/bin
添加到PATH环境变量并按如下所示将其导出来解决此问题。
$ export PATH=$PATH:"/usr/bin"
![](https://img-blog.csdnimg.cn/img_convert/f8c5962df65ca5031b92d0fc5437927f.png)
未安装 (Not Installed)
We generally assume that application is all readily installed. But default installed applications and commands changes from distribution to distribution or release from release
我们通常认为应用程序很容易安装。 但是默认安装的应用程序和命令会在发行版本之间发生变化,或者在发行版本之间发生变化
$ aircrack-ng
![](https://img-blog.csdnimg.cn/img_convert/6e8d1e0ef5e77a8738889587be36c371.png)
So we can solve this by installing the given package or tool like below.
因此,我们可以通过安装如下所示的给定软件包或工具来解决此问题。
$ sudo apt install aircrack-ng
![Install aircrack-ng](https://img-blog.csdnimg.cn/img_convert/f419b3c97ca87c622cfcea7a7684a328.png)
翻译自: https://www.poftut.com/linux-command-not-found-error-solution/
linux命令找不到命令