`
liaofeng_xiao
  • 浏览: 125979 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Linux Bash shell Command

 
阅读更多
生活在 Bash shell 中,熟记以下快捷键,将极大的提高你的命令行操作效率。

编辑命令

Ctrl + a :移到命令行首
Ctrl + e :移到命令行尾
Ctrl + f :按字符前移(右向)
Ctrl + b :按字符后移(左向)
Alt + f :按单词前移(右向)
Alt + b :按单词后移(左向)
Ctrl + xx:在命令行首和光标之间移动
Ctrl + u :从光标处删除至命令行首
Ctrl + k :从光标处删除至命令行尾
Ctrl + w :从光标处删除至字首
Alt + d :从光标处删除至字尾
Ctrl + d :删除光标处的字符
Ctrl + h :删除光标前的字符
Ctrl + y :粘贴至光标后
Alt + c :从光标处更改为首字母大写的单词
Alt + u :从光标处更改为全部大写的单词
Alt + l :从光标处更改为全部小写的单词
Ctrl + t :交换光标处和之前的字符
Alt + t :交换光标处和之前的单词
Alt + Backspace:与 Ctrl + w 相同类似,分隔符有些差别 [感谢 rezilla 指正]
重新执行命令

Ctrl + r:逆向搜索命令历史
Ctrl + g:从历史搜索模式退出
Ctrl + p:历史中的上一条命令
Ctrl + n:历史中的下一条命令
Alt + .:使用上一条命令的最后一个参数
控制命令

Ctrl + l:清屏
Ctrl + o:执行当前命令,并选择上一条命令
Ctrl + s:阻止屏幕输出
Ctrl + q:允许屏幕输出
Ctrl + c:终止命令
Ctrl + z:挂起命令
Bang (!) 命令

!!:执行上一条命令
!blah:执行最近的以 blah 开头的命令,如 !ls
!blah:p:仅打印输出,而不执行
!$:上一条命令的最后一个参数,与 Alt + . 相同
!$:p:打印输出 !$ 的内容
!*:上一条命令的所有参数
!*:p:打印输出 !* 的内容
^blah:删除上一条命令中的 blah
^blah^foo:将上一条命令中的 blah 替换为 foo
^blah^foo^:将上一条命令中所有的 blah 都替换为 foo
友情提示:

以上介绍的大多数 Bash 快捷键仅当在 emacs 编辑模式时有效,若你将 Bash 配置为 vi 编辑模式,那将遵循 vi 的按键绑定。Bash 默认为 emacs 编辑模式。如果你的 Bash 不在 emacs 编辑模式,可通过 set -o emacs 设置。
^S、^Q、^C、^Z 是由终端设备处理的,可用 stty 命令设置。
分享到:
评论

相关推荐

    linux bash shell中文手册

    1.概述 (SYNOPSIS) ...3.描述 (DESCRIPTION) ...18. 简单命令扩展("SIMPLE COMMAND EXPANSION") 19. 命令执行(COMMAND EXECUTION) 20. 命令执行环境(COMMAND EXECUTION ENVIRONMENT) 21. 环境(ENVIRONMENT) 22. 退出

    linux bash手册(英文,version 4.2)

    linux平台的bash shell开发帮助文档(手册),英文版,版本4.2。日常开发shell翻阅, 章节如下: Definitions:: Some definitions used i n the rest of this manual. Basic Shell Features:: The shell "building ...

    Learning the bash Shell, 3rd Edition

    Learning the bash Shell, 3rd Edition This refreshed edition serves as the most valuable guide yet to the bash shell. It's full of practical examples of shell commands and programs guaranteed to ...

    Linux教程 Shell精华文章.chm

    bash(Bourne Again Shell) 是 Linux 的缺省 shell,并被大多数用户所使用,在本文中你将学会: 什么是shell Linux上最常见的shell 命令补齐(Command-line completion)和通配 命令历史记录(Command history)和...

    Pro.Bash.Programming.Scripting.the.GNULinux.Shell.2nd.Edition

    The Bash shell is a complete programming language, not merely a glue to combine external Linux commands. By taking full advantage of Shell internals, Shell programs can perform as snappily as ...

    Penetration Testing with the Bash shell

    This book teaches you to take your problem solving capabilities to the next level with the Bash shell, to assess network and application level security by leveraging the power of the command-line ...

    Linux的shell好比DOS的COMMAND.COM,

    Linux的shell好比DOS的COMMAND.COM,在用户和系统之间架起一座桥梁,让用户方便地操作系统。由于Linux是一个完全开放的平 台,有许多人都为它编写了Shell程序。其中的BASH(Baurne Again SHell)容纳了其他Shell程序的...

    LinuxBash:有用Linux Bash Shell脚本..

    Linux的Bash 该存储库适用于Linux用户。 免责声明;... 硬件测试于:Raspberry Pi 3 Model B Rev 1.2操作系统:Ubuntu MATE 20.04.1 Shell:bash 4.4.20 Terminal:mate-terminal Linux应用程序安装 Sc

    轻松学用 Linux + shell 编程.pdf

    如同 DOS 下有 NDOS,4DOS,DRDOS 等不同的命令解译程序可以取代标准的 command.com ,UNIX 下除了 Bourne shell(/bin/sh) 外还有 C shell(/bin/csh)、Korn shell(/bin/ksh)、Bourne again shell(/bin/bash)、Tenex ...

    Linux下Shell编程

    Shell是一种具备特殊功能的程序, 它是介于使用者和 UNIX/Linux 操作系统之核心程序(kernel)间的一个接口。 为了对用户屏蔽内核的复杂性,也为了保护内核以免用户误操作造成损害,在内核的周围建了一个外壳(shell)...

    the linux command line

    The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell. Along the way you'll learn the timeless skills handed down by...

    安卓系统下的bash shell,ssh服务器,gcc编译器以及vim文本编辑器等

    安卓系统下的bash shell,ssh服务器,gcc编译器以及vim文本编辑器等 使用vim编辑多个文件 vim file1 file2 file3 ... :next查看或编辑后一个文档的内容 :prev查看或编辑前一个文档的内容 :first查看或...

    Mastering Linux Shell Scripting 2nd Edition

    First, you'll learn about Linux shells and why we chose the bash shell. Then, you'll learn how to write a simple bash script and how to edit your bash script using Linux editors. Following this, you ...

    Beginning.the.Linux.Command.Line.2nd.Edition.14302683

    This is Linux for those of us who don’t mind typing. All Linux users and administrators tend to like the flexibility and ...Chapter 14: Introduction to Bash Shell Scripting Appendix A: Installing Linux

    Mastering Linux Shell Scripting

    Shell scripting is a quick method to prototype a complex application or a problem by automating tasks when working on Linux-based systems. Using both simple one-line commands and command sequences ...

    Linux_Shell_Scripting_Cookbook

     Packed with easy-to-follow examples to exercise all the features of the Linux shell scripting language  Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of ...

    The Linux Command Line

    The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell. Along the way you'll learn the timeless skills handed down by...

    linux下shell编程

    Shell是一种具备特殊功能的程序, 它是介于使用者和 UNIX/Linux 操作系统之核心程序(kernel)间的一个接口。 为了对用户屏蔽内核的复杂性,也为了保护内核以免用户误操作造成损害,在内核的周围建了一个外壳(shell)...

    shell脚本执行jps时:-bash: jps: command not found

    我构建了hadoop集群。我们一定会写一个shell脚本去每一个节点上去jps,查看每个节点的进程情况。 原先以为shell很简单: #!/bin/bash #查看每个节点运行情况 for((host=101;...-bash: jps: command not found

    shell:介绍一些有关与Bash Shell的内容。如Linux中的命令、Shell脚本的写法、Shell语言的知识

    如Linux中的命令、Shell脚本的写法、Shell语言的知识。 command目录 保存了bash shell中常见的一些命令的使用方法,其中每个文件讲述一个命令。文件中包括命令的功能、可用的选项、使用方法。 该路径下文件的详细...

Global site tag (gtag.js) - Google Analytics