realpath函数linux,Linux realpath 命令 command not found realpath 命令详解 realpath 命令未找到 realpath 命令安装 - Com...

显示行号

|

选择喜欢的代码风格

默认

GitHub

Dune

LakeSide

Plateau

Vibrant

Blue

Eighties

Tranquil

realpath 命令显示文件或目录的解析绝对路径。

realpath 命令安装:

-bash/zsh: realpath command not found

#Debian

apt-get install realpath

#Ubuntu

apt-get install realpath

#Alpine

apk add coreutils

#Arch Linux

pacman -S coreutils

#Kali Linux

apt-get install coreutils

#CentOS

yum install coreutils

#Fedora

dnf install coreutils

#OS X

brew install realpath

#Raspbian

apt-get install coreutils

#Docker

docker run cmd.cat/realpath realpath

realpath 命令补充说明:

realpath 命令将每个文件名参数转换为绝对路径名,该绝对路径名不包含符号链接或 special 组成部分 . 或 .. 目录条目。

PS:readlink 命令的 -e 选项提供了几乎相同的功能。

realpath 命令语法:

realpath [OPTION]... FILE...

realpath [-s|--strip] [-z|--zero] filename ...

realpath --h|--help

realpath --v|--version

realpath 命令选项:

-s, --strip

Only strip . and .., components, but do not resolve symbolic links.

-z, --zero

Separate output filenames with the null character instead of newline, so it can be used with the '-0' option of xargs(1).

-h, --help

打印简短用法信息。

-v, --version

显示realpath的版本号

realpath 命令参数:

目标文件

realpath 命令实例:

realpath 显示文件或目录的绝对路径:

realpath path/to/file_or_directory

realpath 要求所有路径组件都存在:

realpath --canonicalize-existing path/to/file_or_directory

realpath 在符号链接之前解析 .. 组件:

realpath --logical path/to/file_or_directory

realpath 禁用符号链接扩展:

realpath --no-symlinks path/to/file_or_directory

realpath 禁止显示错误消息:

realpath --quiet path/to/file_or_directory

realpath 命令扩展阅读:

realpath 命令评论

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值