在 UNIX 中,许多文件扩展名不包含前面的点,如 inbashrc
而不是bash.rc
或ssh_config
而不是ssh.config
我也想添加 dircolor 规则_config
。但是,当我添加以下行时:
_config 01;31
Run Code Online (Sandbox Code Playgroud)
我收到一个错误: dircolors: `/etc/dircolors':126: unrecognized keyword _config
是否可以_ext
向 dircolors添加扩展?
您可以使用*_config 01;31
.
来自man 5 dir_colors
:
*extension color-sequence
Specifies the color used for any file that ends in extension.
.extension color-sequence
Same as *.extension. Specifies the color used for any file that ends
in .extension. Note that the period is included in the extension, which
makes it impossible to specify an extension not starting with a period,
such as ~ for emacs backup files. This form should be considered obsolete.
Run Code Online (Sandbox Code Playgroud)