提示-bash: command not found的解决方法集锦

错误原因

  最近很多小伙伴私信我说老是遇到命令找不到的情况,这里开一篇插个队说一下这个问题,做个总结。当我们在 Linux(或shell)下执行一个命令时,报 -bash: XXXX: command not found,有三个可能的原因:

  1. 你将命令的名称拼错了。

  2. 该命令还没有安装。

  3. 该命令是一个可执行脚本,但其位置未知。

解决方案

第一个很简单,仔细排查一下,命令或者文件名之类的写错了没有。

第三个这和Windows是相同的道理,都是环境变量惹的祸,就是说你的 命令的 执行文件不在 /usr/bin 或者 /etc/init.d 中,他就找不到 执行该命令的 文件来执行。思路是将该应用的 bin 目录 放入到 profile 文件中就OK了,步骤如下:

  1. find / -name profile #找到该文件(这个文件相当于 你在Windows 中加入环境变量那块),一般该文件在 /etc/profile 这里
  2. vim profile #编辑该文件
  3. export PATH="$PATH:/phpstudy/mysql/bin" #在该文件中加入 command not found 的应用 bin 目录,这里我是将 mysql 的 bin 放到这里,因为我是 mysqld / mysqldump / mysqladmin 命令用不了
  4. source /etc/profile // 更新配置(不用重启系统)

这还不行那就是第二个原因了,那就是没有安装这个插件了,解决办法如下:

  1. -bash: rz: 未找到命令
    yum install lrzsz

  2. 提示-bash: telnet: command not found的解决方法

yum list telnet*                  列出telnet相关的安装包
yum install telnet-server         安装telnet服务
yum install telnet.*              安装telnet客户端
  1. -bash: wget: command not found
    yum install wget -y

Debian/Ubuntu系统,需要执行以下命令:
apt-get install -y wget

  1. -bash: unzip: command not found
    yum install unzip

  2. -bash: ntpdate: command not found
    yum install ntpdate

  3. -bash: nmap: command not found
    yum install nmap

  4. -bash: lsof: command not found
    yum install lsof -y

  5. -bash: fuser: command not found
    yum install psmisc

  6. -bash: yum-config-manager: command not found
    yum -y install yum-utils

  7. -bash: psql: command not found
    yum install postgresql 或者 yum install postgresql-server

  8. ifconfig: command not found
    yum install -y net-tools

  9. -bash: netstat: command not found
    yum install -y net-tools

  10. firewall-cmd: command not found
    yum install firewalld -y

  11. multipath: command not found
    yum install device-mapper-multipath

  12. ip: command not found (CentOS Linux release 7.8.2003 (Core) )
    yum install initscripts

  13. autoreconf: command not found
    yum install install autoconf -y

  14. autoreconf: failed to run autopoint: No such file or directory err:
    autoreconf: running: autopoint --force
    Can’t exec “autopoint”: No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 345.
    autoreconf: failed to run autopoint: No such file or directory
    autoreconf: autopoint is needed because this package uses Gettext fixed:
    yum install -y gettext-devel

  15. yum-builddep: command not found
    yum install yum-utils -y

  16. rpmbuild: command not found
    yum install rpm-build -y

  17. Redirecting to /bin/systemctl stop iptables.service
    Failed to stop iptables.service: Unit iptables.service not loaded.
    yum install iptables-services
    实际上,centos7后是使用的基于iptable的

systemctl stop firewalld
systemctl mask firewalld

设置开机启动:

systemctl stop iptables
systemctl start iptables
systemctl restart iptables
systemctl reload iptables
systemctl enable iptables

保存设置:
service iptables save

1)查看防火状态

    systemctl status firewalld
    service  iptables status

2)暂时关闭防火墙

    systemctl stop firewalld
    service  iptables stop

3)永久关闭防火墙

 systemctl disable firewalld
 chkconfig iptables off

4)重启防火墙

 systemctl enable firewalld
 service iptables restart  

5)永久关闭后重启(未测试)
chkconfig iptables on

转载自:https://blog.csdn.net/u014727709/article/details/130915064
欢迎start,欢迎评论,欢迎指正

### 寻找适用于 E900V21E 设备的刷机包 对于希望获取适合于 E900V21E 的刷机包的需求,存在两个主要途径可以考虑。 #### 官方或社区支持的通刷资源文件 一个选项是从官方或是活跃的技术社区下载经过验证可用于特定型号设备的通用刷机资源文件。例如,在 GitCode 上有一个公开项目提供了针对 E900V22E 和 E900V21E 型号设计的通刷资源文件[^1]。此资源不仅兼容 S905L3B 及 S905L2B 处理器架构,还特别加入了对 5621DS Wi-Fi 模块的支持特性,并且基于截至到 2022 年底发布的语音助手更新版本构建而成。访问该项目页面可以直接找到并下载所需的刷机资料。 ```bash # 访问GitCode上的开源工具箱项目主页 https://gitcode.com/open-source-toolkit/0bbd6 ``` #### 预制固件集合中的专用固件包 另一个选择则是利用已有的预制固件库来定位专门面向 E900V21E 或相近变种如 E900V21D 所准备好的卡刷固件包。这类资源通常被整理在一个分类清晰、易于查找的位置,比如按照品牌划分再细分至具体产品线的方式存储着各种不同类型的固件镜像。对于创维品牌的这些特定型号而言,可以在名为“其他桌面--固件大全”的目录结构下进一步导航至包含 CW 系列在内的子文件夹内寻得目标固件[^2]。 ```plaintext # 固件路径指引如下: /B《其他桌面--固件大全》>4《 创维CW固件合集》>/《E900V21D》/《E900V21E》(编号639) ``` 无论采用哪种方式获得刷机包之前都应该仔细阅读相关文档说明以及确认自己所使用的硬件配置是否完全匹配所提供的软件环境,以免造成不必要的麻烦甚至损坏设备的风险。
评论 29
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

想你依然心痛

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值