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://codercto.com/courses/l/14.html

查看所有标签

A Byte of Python

A Byte of Python

Swaroop C H / Lulu Marketplace / 2008-10-1 / USD 27.98

'A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save t......一起来看看 《A Byte of Python》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具