小编Sil*_*137的帖子

cd 命令的 CDPATH 中的“替代目录名称”是什么?

在 cd 中,bash 帮助页面:

The variable CDPATH defines the search path for the directory containing
DIR.  Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory.  If DIR begins
with a slash (/), then CDPATH is not used.
Run Code Online (Sandbox Code Playgroud)

但是我不理解“替代目录”的概念,并且找不到说明冒号 ( :) 与cd命令一起使用的示例。

command-line bash cd-command

13
推荐指数
2
解决办法
979
查看次数

使用 less / search 命令时使用锚 ^ 模式

在浏览 Linux 手册页时,有时您需要查询手册页中诸如-p或 之类的标志的含义。-al

手册页的默认文本阅读器较少,我尝试使用 / 搜索来查找公共标志列表定义中的第一个匹配项:

/^-p
Run Code Online (Sandbox Code Playgroud)

Pattern not found发生了却不起作用。

这个技巧在 vim 中工作时有效,但在阅读手册页时不适用于 less。

有没有办法实现这个要求呢?

less man search pattern-matching

5
推荐指数
1
解决办法
737
查看次数

标签 统计

bash ×1

cd-command ×1

command-line ×1

less ×1

man ×1

pattern-matching ×1

search ×1