作者:平凡小迪 | 来源:互联网 | 2023-05-28 07:22
我意识到这可能是一个愚蠢的问题,但是我安装了Centos-7最小服务器,并且“ which”命令不存在或丢失。我有一个需要它的脚本,但是我找不到要安装它的yum软件包。代码在下面,来自make文件。
which grep > /dev/null 2> /dev/null
if test "$?" != "0"
then
echo "\"grep\" command not found."
echo "Installation is aborted."
exit 1
fi
任何帮助将不胜感激...这是困难的,即使不是不可能的谷歌
1> Wintermute..:
要在CentOS中查找软件包,请使用 yum whatprovides
:
yum whatprovides *bin/which
在这种情况下,该包称为which
,因此
yum install which
应该把它拉进去。