Tcsh Complete

这篇博客详细介绍了Tcsh的命令补全功能,包括不同类型的补全方式如current-word、next-word、position-dependent等,以及如何针对sudo命令进行补全。还给出了多个例子演示如何设置和使用这些补全,帮助用户更高效地使用Tcsh。
摘要由CSDN通过智能技术生成

1、Tcsh Complete 参考

最近在研究tcsh的补全相关知识,于是将相关资料列出来,然后加以分析,据我所知,目前相关的材料大多是英文的,而且百度搜索出来匹配结果较差,而国内又不方便用谷歌,故写出来记录一下:

文件编辑位置: etc/csh.tcshrc· 有的是.cshrc 或者 ~/.tcshrc

本文主要涉及tcsh的补全:
模板:

complete [command [word/pattern/list[:select]/[[suffix]/] …]]

作用:
通过定义一种补全方式,通过输入一部分命令,然后按TAB键,实现将期待的补全列出来,当我们对一些命令较长,而且记不清的时候尤其有用。

首先

complete可以理解为是一个Linux的内建命令或者函数,然后,就是command,理解为当 cd、man、ls、这样的命令。

然后

word部分,就是我们需要给出的补全方式,补全位置?第几个位置补全,如何补全?可选参数如下:


word specifies which word relative to the current word is to be completed, and can be one of the following:
c Current-word completion. pattern is a glob-pattern which must match the beginning of the current word on the command line. pattern is ignored when completing the current word.
C like c, but includes pattern when completing the current word.
n Next-word completion. pattern is a glob-pattern which must match the beginning of the previous word on the command line.
N Like n, but must match the beginning of the word two before the current word.
p Position-dependent completion. pattern is a numeric range, with the same syntax used to index shell variables, which must include the current word.


list

The list of possible completions, which can be one of the following:
a Aliases
b Bindings (editor commands)
d Directories
D Directories which begin with the supplied path prefix
e Environment variables
f File names
F File names which begin with the supplied path prefix

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值