Linux which命令

Linux 教程 · 2019-02-14 08:41:48

Linux which命令用于查找文件。

which指令会在环境变量$PATH设置的目录里查找符合条件的文件。

语法

which [文件...]

参数

  • -n<文件名长度>  指定文件名长度,指定的长度必须大于或等于所有文件中最长的文件名。
  • -p<文件名长度>  与-n参数相同,但此处的<文件名长度>包括了文件的路径。
  • -w  指定输出时栏位的宽度。
  • -V  显示版本信息。

实例

使用指令"which"查看指令"bash"的绝对路径,输入如下命令:

$ which bash

上面的指令执行后,输出信息如下所示:

/bin/bash                   #bash可执行程序的绝对路径 

点击查看所有 Linux 教程 文章: https://www.codercto.com/courses/l/14.html

查看所有标签

The Science of Programming

The Science of Programming

David Gries / Springer / 1989-4-21 / USD 99.00

Describes basic programming principles and their step-by- step applications.Numerous examples are included.一起来看看 《The Science of Programming》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试