V2EX  ›  英汉词典
Enqueued related words: Cwd

Dirname

释义 Definition

dirname(常见于计算机/命令行语境)指“目录名”,也可特指类 UNIX 系统中的 dirname 命令/函数:用于从一个路径(path)中提取其上级目录路径,去掉最后的文件名或最后一级路径部分。

发音 Pronunciation

/ˈdɜːrneɪm/

例句 Examples

Run dirname on this path to get the folder name.
对这个路径运行 dirname 来获取目录名。

In a shell script, we used dirname "$0" to locate the script’s parent directory and load configuration files reliably.
在 shell 脚本中,我们使用 dirname "$0" 来定位脚本所在的上级目录,从而可靠地加载配置文件。

词源 Etymology

来自 dir(directory,目录的缩写)+ name(名称)的合成词;在 UNIX 传统中既可作为“目录名”的泛称,也常被固定用作提取目录部分的工具名(如 dirname 命令)。

相关词 Related Words

文学与著名作品中的用例 Literary & Notable Works

  • The Linux Programming Interface(Michael Kerrisk):在文件路径处理与进程/脚本相关示例中常涉及 dirname/basename 这类概念与工具。
  • Advanced Programming in the UNIX Environment(W. Richard Stevens 等):讲解 UNIX 文件系统与路径处理时会讨论与“目录/路径分解”相关的用法与思想(常与 dirname 语境相连)。
  • UNIX/Linux dirname(1) 手册页(man page)与 POSIX/工具文档:对 dirname 的行为、参数与输出有权威描述。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   733 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 19:10 · PVG 03:10 · LAX 11:10 · JFK 14:10
♥ Do have faith in what you're doing.