在Bash中,如果我按了两次选项卡键,就会看到:
显示所有1092的可能性?(y或n)
片段:
! diff ifconfig mount.fuse rcsdiff tiff2pdf
./ diff3 ifdown mount.ntfs-3g rcsmerge tiff2ps
: diffutils-cmp ifenslave mount.ntfs-fuse rdisc tiff2rgba
GET diffutils-diff iftop mountpoint rdjpgcom tiffcmp
HEAD diffutils-diff3 ifup msgattrib read tiffcp
MAKEDEV diffutils-sdiff ifup-local msgcat readelf tiffdiff
POST dig igawk msgcmp readlink tiffdither
[ dir igd-client msgcomm readonly tiffdump
--More--我认为如果我在$PATH环境变量中搜索目录中的所有可执行文件,那么就会产生一个与more显示的数据相匹配的列列表。
这是我的第一次尝试:
echo $PATH | sed -e 's/:/ /g' -e "s/^/find / " | sh > commandlist.txt
wc -l commandlist.txt
1114 commandlist.txt因此,我添加了-xtype f和-perm /u=x,但仍然没有得到1092:
echo $PATH | sed -e 's/:/ /g' -e "s/^/find / " -e "s/$/ -xtype f -perm \/u=x/" | sh | wc -l
1107Bash中的double tab key press是如何生成其全部“可能性”值的?
发布于 2012-02-25 20:02:10
这似乎是可行的:
compgen -cab | sort | uniq | wc -l在我的机器上,它显示的数字与选项卡完成的内容相同。
https://stackoverflow.com/questions/9446648
复制相似问题