bash - move faster
http://teohm.com/blog/shortcuts-to-move-faster-in-bash-command-line/
Shortcuts to move faster in Bash command line
Jan 4, 2012
Nowadays, I spend more time in Bash shell, typing longer commands. One of my new year resolutions for this year is to stop using left/right arrow keys to move around in the command line. I learned a few shortcuts a while ago.
Last night, I spent some time to read about “Command Line Editing” in the bash manual. The bash manual is a well-written piece of documentation. I think I should read it more often.
Well, here’s the new shortcuts I learned:
Basic moves
- Move back one character.
Ctrl+b - Move forward one character.
Ctrl+f - Delete current character.
Ctrl+d - Delete previous character.
Backspace - Undo.
Ctrl+-
Moving faster
- Move to the start of line.
Ctrl+a - Move to the end of line.
Ctrl+e - Move forward a word.
Meta+f(a word contains alphabets and digits, no symbols) - Move backward a word.
Meta+b - Clear the screen.
Ctrl+l
What is Meta? Meta is your Alt key, normally. For Mac OSX user, you need to enable it yourself. Open Terminal > Preferences > Settings > Keyboard, and enable Use option as meta key. Meta key, by convention, is used for operations on word.
Cut and paste (‘Kill and yank’ for old schoolers)
- Cut from cursor to the end of line.
Ctrl+k - Cut from cursor to the end of word.
Meta+d - Cut from cursor to the start of word.
Meta+Backspace - Cut from cursor to previous whitespace.
Ctrl+w - Paste the last cut text.
Ctrl+y - Loop through and paste previously cut text.
Meta+y(use it afterCtrl+y) - Loop through and paste the last argument of previous commands.
Meta+.
Search the command history
- Search as you type.
Ctrl+rand type the search term; RepeatCtrl+rto loop through results. - Search the last remembered search term.
Ctrl+rtwice. - End the search at current history entry.
Ctrl+j - Cancel the search and restore original line.
Ctrl+g
Need more?
- A comprehensive bash editing mode cheatsheet by Peteris Krumin (catonmat.net).
- Vim users! Do you know you can switch to Vi-style editing mode? Here: vi-style cheatsheet.
- Bash command line editing is actually handled by GNU Readline Library. So just dive into Readline manual for everything else.
bash - move faster的更多相关文章
- [Bash] Move and Copy Files and Folders with Bash
In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to ...
- shell浅谈之十函数
转自:http://blog.csdn.net/taiyang1987912/article/details/39583179 一.简介 Linux Shell编 程中也会使用到函数,函数可以把大的命 ...
- iOS 学习 - 10下载(3) NSURLSession 音乐 篇
使用 NSURLSession 下载,需要注意的是文件下载文件之后会自动保存到一个临时目录,需要开发人员自己将此文件重新放到其他指定的目录中 // // ViewController.m // Web ...
- Deep Learning in a Nutshell: History and Training
Deep Learning in a Nutshell: History and Training This series of blog posts aims to provide an intui ...
- September 26th 2016 Week 40th Monday
The land didn't move, but moved. The sea wasn't still, yet was still. 大地止而亦行,大海动而亦静. Still waters ru ...
- 【HDU 3810】 Magina (01背包,优先队列优化,并查集)
Magina Problem Description Magina, also known as Anti-Mage, is a very cool hero in DotA (Defense of ...
- PhoenixFD插件流体模拟——UI布局【Gird】详解
流体网格 本文主要讲解Grid折叠栏中的内容 主要内容 Overview 综述 Parameters 参数 General 普通参数 Example: Scene Scale Example: Gri ...
- Robot Operating System (ROS)学习笔记3---键盘控制
搭建环境:XMWare Ubuntu14.04 ROS(indigo) 转载自古月居 转载连接:http://www.guyuehome.com/253 一.创建控制包 catkin_creat ...
- Five reasons phosphorene may be a new wonder material
A material that you may never have heard of could be paving the way for a new electronic revolution. ...
随机推荐
- vue ---webpack 打包上线
先来描述一下期间遇到的问题有哪些: 1.打包后将 dist 文件夹和 index.html 放到 tomcat,在浏览器中访问时,出现空白页,f12 提示 404. 2.打包好的静态资源均是绝对路径 ...
- Spark MLlib架构解析(含分类算法、回归算法、聚类算法和协同过滤)
Spark MLlib架构解析 MLlib的底层基础解析 MLlib的算法库分析 分类算法 回归算法 聚类算法 协同过滤 MLlib的实用程序分析 从架构图可以看出MLlib主要包含三个部分: 底层基 ...
- the way to go
推荐两本书 关于go语言的 The way to go Go语言编程高清完整版电子书.pdf
- BZOJ2119: 股市的预测(后缀数组)
Description 墨墨的妈妈热爱炒股,她要求墨墨为她编写一个软件,预测某只股票未来的走势.股票折线图是研究股票的必备工 具,它通过一张时间与股票的价位的函数图像清晰地展示了股票的走势情况.经过长 ...
- IDFA和IMEI
这里有一些解释: https://www.zhihu.com/question/38856446
- amazeui学习笔记二(进阶开发4)--JavaScript规范Rules
amazeui学习笔记二(进阶开发4)--JavaScript规范Rules 一.总结 1.注释规范总原则: As short as possible(如无必要,勿增注释):尽量提高代码本身的清晰性. ...
- Eclipse如何从导入SVN上导入项目
1.右键单击,选择 Import,进入导入项目窗口 2.点击选择从SVN检出项目,点击Next下一步 3.选择创建新的资源库位置,点击Next,如果项目之前已经导入过删除掉了,重新导入的时候,只需勾选 ...
- 洛谷 P2069 松鼠吃果子
P2069 松鼠吃果子 题目描述 有N个一种松鼠喜欢吃的果子由下向上串排成一列,并标号1,2,...N.一只松鼠从最下果子开始向上跳,并且第i次跳可以一次跳过i*i*i除以5的余数+1个果子(=i*i ...
- HTTP网络协议(二)
HTTP报文内的HTTP信息 HTTP协议交互的信息被称为HTTP报文,请求端的HTTP报文叫做请求报文,响应端的叫做响应报文. HTTP为了提升传输速率,其在传输数据时,按照数据原样进行压缩传 ...
- 【转】CentOS/RHEL/OracleLinux使用UDEV配置ASMDISK
转自:http://blog.csdn.net/staricqxyz/article/details/8332566 RHEL 5 / CentOS 5 / Oracle Linux 5 [root@ ...