当前位置: 首页 > news >正文

Bash Shell 快捷键的学习使用

这篇 Bash Shell Shortcuts 的快捷键总结的非常好。值得学习。下面内容大多数是拷贝粘贴与总结.

CTRL 键相关的快捷键:

Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command  //用的最多了吧?
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen  //清屏,类似 clear 命令
Ctrl + r - Search the history backwards  //查找历史命令
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + u - Delete backward from cursor // 密码输入错误的时候比较有用
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command
补充:
Ctrl + h - 删除当前字符
Ctrl + w - 删除最后输入的单词 

ALT 键相关的快捷键:

平时很少用。有些和远程登陆工具冲突。

Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + back-space - Delete backward from cursor 
// SecureCRT 如果没有配置好,这个就很管用了。

其他特定的键绑定:

输入 bind -P 可以查看所有的键盘绑定。这一系列我觉得更为实用。

Here "2T" means Press TAB twice
$ 2T - All available commands(common) //命令行补全,我认为是 Bash 最好用的一点
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ ./2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd" //第一次见到,很好用
$ $2T - All Sys variables //写Shell脚本的时候很实用
$ @2T - Entries from "/etc/hosts"  //第一次见到
$ =2T - Output like ls or dir //好像还不如 ls 快捷
补充:
Esc + T - 交换光标前面的两个单词

很多来自GNU 的 readline 库。另外一份总结也很好

记忆是所有技术人员的敌人。一次要把所有的都记住是不可能的。针对自己的使用习惯,对少数快捷键反复使用,短期内就会有效果。

你还知道那些好用的快捷键 ? 补充一下 ?

EOF

转载于:https://www.cnblogs.com/WangCT/p/3420754.html

相关文章:

  • 8UFTP
  • 今天linux遇到的问题
  • 在论坛中出现的比较难的sql问题:12(递归问题2)
  • LeetCode:Balanced Binary Tree
  • 看博客学学Android(二十二)
  • Jquery重新学习之一[加载与属性html(),text(),val()]
  • Ubuntu13.10安装仿苹果启动菜单Cairo-Dock
  • Linux awk 命令 说明
  • 数组资源
  • html取出指定div的内容(不怕嵌套)
  • (转)Linux整合apache和tomcat构建Web服务器
  • 同一台Windows机器中启动多个Memcached服务
  • WebSphere MQ 入门指南
  • Glusterfs3.3.1DHT(hash分布)源代码分析
  • 进入保护模式(一)
  • [ 一起学React系列 -- 8 ] React中的文件上传
  • 【译】理解JavaScript:new 关键字
  • 10个确保微服务与容器安全的最佳实践
  • express.js的介绍及使用
  • Javascript Math对象和Date对象常用方法详解
  • KMP算法及优化
  • mysql 5.6 原生Online DDL解析
  • PHP 的 SAPI 是个什么东西
  • Python学习之路13-记分
  • vue数据传递--我有特殊的实现技巧
  • 大数据与云计算学习:数据分析(二)
  • 技术发展面试
  • 理解IaaS, PaaS, SaaS等云模型 (Cloud Models)
  • 通过来模仿稀土掘金个人页面的布局来学习使用CoordinatorLayout
  • 为什么要用IPython/Jupyter?
  • 我感觉这是史上最牛的防sql注入方法类
  • 小程序01:wepy框架整合iview webapp UI
  • 1.Ext JS 建立web开发工程
  • 分布式关系型数据库服务 DRDS 支持显示的 Prepare 及逻辑库锁功能等多项能力 ...
  • #我与Java虚拟机的故事#连载04:一本让自己没面子的书
  • (DenseNet)Densely Connected Convolutional Networks--Gao Huang
  • (Python第六天)文件处理
  • (附源码)ssm基于微信小程序的疫苗管理系统 毕业设计 092354
  • (一)RocketMQ初步认识
  • (原创)攻击方式学习之(4) - 拒绝服务(DOS/DDOS/DRDOS)
  • (原創) 如何優化ThinkPad X61開機速度? (NB) (ThinkPad) (X61) (OS) (Windows)
  • (转)shell中括号的特殊用法 linux if多条件判断
  • (转)自己动手搭建Nginx+memcache+xdebug+php运行环境绿色版 For windows版
  • .bat批处理(九):替换带有等号=的字符串的子串
  • .mkp勒索病毒解密方法|勒索病毒解决|勒索病毒恢复|数据库修复
  • .net core 实现redis分片_基于 Redis 的分布式任务调度框架 earth-frost
  • .net core控制台应用程序初识
  • .Net Remoting(分离服务程序实现) - Part.3
  • .net下简单快捷的数值高低位切换
  • .project文件
  • /proc/interrupts 和 /proc/stat 查看中断的情况
  • @Controller和@RestController的区别?
  • @基于大模型的旅游路线推荐方案
  • [AIGC] MySQL存储引擎详解
  • [ASP]青辰网络考试管理系统NES X3.5