赞
踩
最近很多小伙伴私信我说老是遇到命令找不到的情况,这里开一篇插个队说一下这个问题,做个总结。当我们在 Linux(或shell)下执行一个命令时,报 -bash: XXXX: command not found,有三个可能的原因:
你将命令的名称拼错了。
该命令还没有安装。
该命令是一个可执行脚本,但其位置未知。
第一个很简单,仔细排查一下,命令或者文件名之类的写错了没有。
第三个这和Windows是相同的道理,都是环境变量惹的祸,就是说你的 命令的 执行文件不在 /usr/bin 或者 /etc/init.d 中,他就找不到 执行该命令的 文件来执行。思路是将该应用的 bin 目录 放入到 profile 文件中就OK了,步骤如下:
find / -name profile
#找到该文件(这个文件相当于 你在Windows 中加入环境变量那块),一般该文件在 /etc/profile 这里vim profile
#编辑该文件export PATH="$PATH:/phpstudy/mysql/bin"
#在该文件中加入 command not found 的应用 bin 目录,这里我是将 mysql 的 bin 放到这里,因为我是 mysqld / mysqldump / mysqladmin 命令用不了这还不行那就是第二个原因了,那就是没有安装这个插件了,解决办法如下:
-bash: rz: 未找到命令
yum install lrzsz
提示-bash: telnet: command not found的解决方法
yum list telnet* 列出telnet相关的安装包
yum install telnet-server 安装telnet服务
yum install telnet.* 安装telnet客户端
yum install wget -y
Debian/Ubuntu系统,需要执行以下命令:
apt-get install -y wget
-bash: unzip: command not found
yum install unzip
-bash: ntpdate: command not found
yum install ntpdate
-bash: nmap: command not found
yum install nmap
-bash: lsof: command not found
yum install lsof -y
-bash: fuser: command not found
yum install psmisc
-bash: yum-config-manager: command not found
yum -y install yum-utils
-bash: psql: command not found
yum install postgresql
或者 yum install postgresql-server
ifconfig: command not found
yum install -y net-tools
-bash: netstat: command not found
yum install -y net-tools
firewall-cmd: command not found
yum install firewalld -y
multipath: command not found
yum install device-mapper-multipath
ip: command not found (CentOS Linux release 7.8.2003 (Core) )
yum install initscripts
autoreconf: command not found
yum install install autoconf -y
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
yum-builddep: command not found
yum install yum-utils -y
rpmbuild: command not found
yum install rpm-build -y
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,欢迎评论,欢迎指正
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。