Solaris系统中提示bash:command not found
来源:互联网 发布:投资公司 知乎 编辑:程序博客网 时间:2024/05/11 18:08
当我们使用一个命令的时候,如:make,提示如下错误:
bash:command not found
这时,我们可以使用以下命令查看下make这个命令在系统中是否存在:
bash-3.00# find / -name make
结果如下所示:
.../usr/share/lib/make/usr/ccs/bin/make/usr/xpg4/bin/make....
首先我们应该知道可执行命令一般是放到bin下边的,所以,我们可以进一步排除,接着我们查看一下/usr/xpg4/bin/make,可以发现这是一个文件夹的名字,最终我们可以确定make命令在/usr/ccs/bin/下面。
下面我们就要考虑了,为什么提示没有这个命令呢,即出现bash:command not found。对于操作系统来说,我们不仅要安装一个命令,同时还要配置环境变量,用环境变量告诉操作系统这个命令在哪里可以找到。只有这样,我们才能正确的调用这个命令。
那么环境变量在哪里配置呢?对应Solaris操作系统来说,全局性的环境变量是在/etc/profile这个文件里的。我们可以在这个文件的最后添加上如下代码:
PATH=$PATH:/usr/ccs/binexport PATH
注意:$PATH:这个值是不能省略的,加上这个的意思是说在原来path值得基础上再加上/usr/ccs/bin这个值。
这时,我们可以关闭掉SecureCRT(一个连接Solaris的工具,之所以需要关闭掉重新连接操作系统,是因为缓存的问题),再次使用:
bash-3.00# make -help
既可以测试make的使用方法。
通过这个例子,我们可以总结出:当我们遇到bash:command not found这样的错误的时候,我们可以按照下面的步骤来逐一排查错误:
1.通过find / -name 报错的命令,查看系统中是否安装了这个命令2.如果安装了,则需要根据查询出来的列表,逐一排查,看看到底哪个可以使用(注意:可执行命令一般是在bin目录下的)3.查看环境变量是否配置了这个命令的路径4.再次测试是否可以使用5.如果第一步没有查询到结果,说明系统没有安装,这个时候我们安装这个命令。
0 0
- Solaris系统中提示bash:command not found
- linux中提示 bash: command not found
- Xshell中输入rz提示:-bash: rz: command not found
- Xshell中输入rz提示:-bash: rz: command not found
- linux下提示 -bash: ******* :command not found
- linux下提示bash:command not found
- inux下提示bash:command not found
- 提示bash: mysql: command not found解决方法
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- linux下提示bash:command not found
- Linux 提示:“bash: ifconfig: command not found”
- 提示:bash: groupadd: command not found
- linux下提示 -bash: ******* :command not found
- HDU 4720 Naive and Silly Muggles
- (转)Combobox 输入的关键字模糊下拉出相应的内容
- JS定时刷新页面及跳转页面
- IAR for stm8 新建工程模板
- LeetCode上关于Min Stack遇到的一个小小问题
- Solaris系统中提示bash:command not found
- applicationContext.xml与spring-severlet.xml加载关系
- android 判断网络
- java实现矩阵相乘
- HDU 3954(线段树)
- jQuery 自定义事件
- HDU 4727 The Number Off of FFF
- 自己总结的一些C/C++语言基础问题
- web集群时session同步的3种方法