博客
关于我
Linux 系统设置 : bind 命令详解
阅读量:268 次
发布时间:2019-03-01

本文共 4845 字,大约阅读时间需要 16 分钟。

bind命令用于显示或设置键盘按键与其相关的功能。

您可以利用bind命令了解有哪些按键组合与其功能,也可以自行指定要用哪些按键组合。

语法

bind [-dlv][-f 
<按键配置文件>
][-m
<按键配置>
][-q
<功能>
]

参数说明

  • -d  显示按键配置的内容。
  • -f<按键配置文件>  载入指定的按键配置文件。
  • -l  列出所有的功能。
  • -m<按键配置>  指定按键配置。
  • -q<功能>  显示指定功能的按键。
  • -v  列出目前的按键配置与其功能。

实例

显示按键组合的所有功能

# bind -l //显示按键组合的内容abortaccept-linealias-expand-linearrow-key-prefixbackward-bytebackward-charbackward-delete-charbackward-kill-linebackward-kill-wordbackward-wordbeginning-of-historybeginning-of-line……省略部分内容vi-goto-markvi-insert-begvi-insertion-modevi-matchvi-movement-modevi-next-wordvi-overstrikevi-overstrike-deletevi-prev-wordvi-putvi-redovi-replacevi-ruboutvi-searchvi-search-againvi-set-markvi-substvi-tilde-expandvi-yank-argvi-yank-toyankyank-last-argyank-nth-argyank-pop

显示当前按键组合的设置

# bind -labortaccept-linealias-expand-linearrow-key-prefixbackward-bytebackward-charbackward-delete-charbackward-kill-linebackward-kill-wordbackward-wordbeginning-of-historybeginning-of-linecall-last-kbd-macrocapitalize-wordcharacter-searchcharacter-search-backwardclear-screencompletecomplete-commandcomplete-filenamecomplete-hostnamecomplete-into-bracescomplete-usernamecomplete-variablecopy-backward-wordcopy-forward-wordcopy-region-as-killdabbrev-expanddelete-chardelete-char-or-listdelete-horizontal-spacedigit-argumentdisplay-shell-versiondo-lowercase-versiondowncase-worddump-functionsdump-macrosdump-variablesdynamic-complete-historyedit-and-execute-commandemacs-editing-modeend-kbd-macroend-of-historyend-of-lineexchange-point-and-markforward-backward-delete-charforward-byteforward-charforward-search-historyforward-wordglob-complete-wordglob-expand-wordglob-list-expansionshistory-and-alias-expand-linehistory-expand-linehistory-search-backwardhistory-search-forwardinsert-commentinsert-completionsinsert-last-argumentkill-linekill-regionkill-whole-linekill-wordmagic-spacemenu-completemenu-complete-backwardnext-historynon-incremental-forward-search-historynon-incremental-forward-search-history-againnon-incremental-reverse-search-historynon-incremental-reverse-search-history-againold-menu-completeoperate-and-get-nextoverwrite-modepossible-command-completionspossible-completionspossible-filename-completionspossible-hostname-completionspossible-username-completionspossible-variable-completionsprevious-historyquoted-insertredraw-current-linere-read-init-filereverse-search-historyrevert-lineself-insertset-markshell-backward-kill-wordshell-backward-wordshell-expand-lineshell-forward-wordshell-kill-wordskip-csi-sequencestart-kbd-macrotab-inserttilde-expandtranspose-charstranspose-wordstty-statusundouniversal-argumentunix-filename-ruboutunix-line-discardunix-word-ruboutupcase-wordvi-append-eolvi-append-modevi-arg-digitvi-back-to-indentvi-bwordvi-bWordvi-change-casevi-change-charvi-change-tovi-char-searchvi-columnvi-completevi-deletevi-delete-tovi-editing-modevi-end-wordvi-eof-maybevi-ewordvi-eWordvi-fetch-historyvi-first-printvi-fwordvi-fWordvi-goto-markvi-insert-begvi-insertion-modevi-matchvi-movement-modevi-next-wordvi-overstrikevi-overstrike-deletevi-prev-wordvi-putvi-redovi-replacevi-ruboutvi-searchvi-search-againvi-set-markvi-substvi-tilde-expandvi-yank-argvi-yank-toyankyank-last-argyank-nth-argyank-poproot@snail-hnlinux:~# root@snail-hnlinux:~# root@snail-hnlinux:~# root@snail-hnlinux:~# root@snail-hnlinux:~# bind -vset bind-tty-special-chars onset blink-matching-paren onset byte-oriented offset completion-ignore-case offset convert-meta offset disable-completion offset echo-control-characters onset enable-keypad offset enable-meta-key onset expand-tilde offset history-preserve-point offset horizontal-scroll-mode offset input-meta onset mark-directories onset mark-modified-lines offset mark-symlinked-directories offset match-hidden-files onset meta-flag onset output-meta onset page-completions onset prefer-visible-bell onset print-completions-horizontally offset revert-all-at-newline offset show-all-if-ambiguous offset show-all-if-unmodified offset skip-completed-text offset visible-stats offset bell-style audibleset comment-begin #set completion-prefix-display-length 0set completion-query-items 100set editing-mode emacsset history-size 1000set keymap emacs

列出指定功能的按键和按键组合

# bind -q abort//请用 调用abort “C-g”, “C-xC-g”, “eC-g”.# bind -q accept-line //列出功能“accept-line”按键以及组合按键//请用 调用accept-line “C-j”, “C-m”.
bind -x '"\C-l":ls -l'    #直接按 CTRL+L 就列出目录

其中keyseq可以使用showkey -a命令来获取:

[root@localhost ~]# showkey -aPress any keys - Ctrl-D will terminate this program^[[A     27 0033 0x1b  上         91 0133 0x5b         65 0101 0x41^[[B     27 0033 0x1b  下         91 0133 0x5b         66 0102 0x42^[[D     27 0033 0x1b  左         91 0133 0x5b         68 0104 0x44^[[C     27 0033 0x1b 右         91 0133 0x5b         67 0103 0x43         32 0040 0x20^M       13 0015 0x0d 字母M^C        3 0003 0x03 Ctrl-C^D        4 0004 0x04 Ctrl-D 退出

 

转载地址:http://gzyt.baihongyu.com/

你可能感兴趣的文章
Mysql 知识回顾总结-索引
查看>>
Mysql 笔记
查看>>
MySQL 精选 60 道面试题(含答案)
查看>>
mysql 索引
查看>>
MySQL 索引失效的 15 种场景!
查看>>
MySQL 索引深入解析及优化策略
查看>>
MySQL 索引的面试题总结
查看>>
mysql 索引类型以及创建
查看>>
MySQL 索引连环问题,你能答对几个?
查看>>
Mysql 索引问题集锦
查看>>
Mysql 纵表转换为横表
查看>>
mysql 编译安装 window篇
查看>>
mysql 网络目录_联机目录数据库
查看>>
MySQL 聚簇索引&&二级索引&&辅助索引
查看>>
Mysql 脏页 脏读 脏数据
查看>>
mysql 自增id和UUID做主键性能分析,及最优方案
查看>>
Mysql 自定义函数
查看>>
mysql 行转列 列转行
查看>>
Mysql 表分区
查看>>
mysql 表的操作
查看>>