[问题]PATH设置,优先,相关文件删除
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 63
- 注册时间: 2008-02-22 20:52
[问题]PATH设置,优先,相关文件删除
我用Linux才不到一个月啊~~~
我用gnuplot的问题和这里一样
viewtopic.php?t=89587&sid=4f645ea1a67bb ... 8db1bfbc63
我的原因是以前自己编译过一个gnuplot。
现在问题来了。这两个gnuplot的路径是不一样的。
自己编译的,启动用的是 /usr/local/bin/gnuplot (这个没有X11)
而用源里的包安装的,启动用的是 /usr/bin/gnuplot
当我在终端输入gnuplot时,系统只会到 /usr/local/bin 里去找。
如果我把 /usr/local/bin/gnuplot 改名,比如 gnuplot_
系统就会提示找不到。(它也不会去 /usr/bin 找)
问题:
1 我怎么才能让系统到 /usr/bin 这个目录去找我要用的 gnuplot 启动?
2 我怎么才去掉 /usr/local/bin 这个PATH变量,我找不到 in
~/.profile
~/.bashrc
/etc/profile
/etc/bash.bashrc
它还会在哪里定义?
3 我以前编译的gnuplot,它生成的那些文件,我怎么找到,并删除?
我用gnuplot的问题和这里一样
viewtopic.php?t=89587&sid=4f645ea1a67bb ... 8db1bfbc63
我的原因是以前自己编译过一个gnuplot。
现在问题来了。这两个gnuplot的路径是不一样的。
自己编译的,启动用的是 /usr/local/bin/gnuplot (这个没有X11)
而用源里的包安装的,启动用的是 /usr/bin/gnuplot
当我在终端输入gnuplot时,系统只会到 /usr/local/bin 里去找。
如果我把 /usr/local/bin/gnuplot 改名,比如 gnuplot_
系统就会提示找不到。(它也不会去 /usr/bin 找)
问题:
1 我怎么才能让系统到 /usr/bin 这个目录去找我要用的 gnuplot 启动?
2 我怎么才去掉 /usr/local/bin 这个PATH变量,我找不到 in
~/.profile
~/.bashrc
/etc/profile
/etc/bash.bashrc
它还会在哪里定义?
3 我以前编译的gnuplot,它生成的那些文件,我怎么找到,并删除?
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
-
- 帖子: 63
- 注册时间: 2008-02-22 20:52
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
-
- 帖子: 1331
- 注册时间: 2006-07-09 12:22
- 来自: 南京
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
-
- 帖子: 1331
- 注册时间: 2006-07-09 12:22
- 来自: 南京
xhy 写了:/usr/local/bin:/usr/bin:/bin:/opt/bin
前面的优先级高于后面的
系统就会提示找不到gnuplot么?不可能吧。gugaotianshi 写了:现在问题来了。这两个gnuplot的路径是不一样的。
自己编译的,启动用的是 /usr/local/bin/gnuplot (这个没有X11)
而用源里的包安装的,启动用的是 /usr/bin/gnuplot
当我在终端输入gnuplot时,系统只会到 /usr/local/bin 里去找。<-- 这一行是对的
如果我把 /usr/local/bin/gnuplot 改名,比如 gnuplot_
系统就会提示找不到。(它也不会去 /usr/bin 找)
这与优先级有何关系呢?前面的优先,但找不到,当然会到后面的目录中找。只要存在,肯定可以找到。
aBiNg:~ ¶ which gnuplot gnuplot_
/usr/bin/gnuplot
/usr/local/bin/gnuplot_
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
果然和我猜想的一样
代码: 全选
If the name is neither a shell function nor a builtin, and contains no slashes, bash searches each element of
the PATH for a directory containing an executable file by that name. Bash uses a hash table to remember the
full pathnames of executable files (see hash under SHELL BUILTIN COMMANDS below). A full search of the direc-
tories in PATH is performed only if the command is not found in the hash table. If the search is unsuccess-
ful, the shell prints an error message and returns an exit status of 127.
If the search is successful, or if the command name contains one or more slashes, the shell executes the named
program in a separate execution environment. Argument 0 is set to the name given, and the remaining arguments
to the command are set to the arguments given, if any.
目前负债150多万
-
- 帖子: 31
- 注册时间: 2008-02-02 18:28