如何获取Linux命令的完整路径名 [英] How to get full path name of a Linux command
本文介绍了如何获取Linux命令的完整路径名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想找出Linux中命令的文件路径,例如 ls
的文件路径为/bin/ls
.如何找出某些命令的确切路径?
I want to find out the file path of commands in Linux e.g., ls
has file path as /bin/ls
. How can I find out the exact path of some commands?
推荐答案
如所指出的,< progName>
可以做到.您也可以尝试:
As pointed out, which <progName>
would do it. You could also try:
whereis -b <progName>
这将列出包含 progName
的所有路径.即我的计算机上的 whereis -b gcc
返回:
This will list all the paths that contains progName
. I.e whereis -b gcc
on my machine returns:
gcc: /usr/bin/gcc /usr/lib/gcc /usr/bin/X11/gcc
这篇关于如何获取Linux命令的完整路径名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文