Linux应用小技巧

简介

  本文针对Linux操作过程中提升工作效率问题,给出常见操作技巧,主要从Linux终端管理、显示git分支、终端快速检索历史命令等方面进行介绍。

  本文内容主要以Ubuntu系统为例进行介绍

Linux终端管理

  常见我们采用Ctrl+Shift+T来创建终端窗口,但是当此类窗口过多时,操作也不是很方便,因此可以采用byobu该工具来进行管理,具体操作如下:

        1) 安装byobu:sudo apt-get install byobu

        2) 应用byobu: 在终端中输入byobu,然后使用如下快捷键:

    F2   Create a new window

    F3   Move to the previous window

    F4  Move to the next window

    F5  Refresh all status notifications

    F6  Detach from the session and logout

    Shift-F6 Detach from the session, but do not logout

    F7  Enter scrollback/search mode

    F8 Rename the current window

    F9 Launch the Byobu Configuration Menu

    Alt-Pageup Scroll back through this window's history

    Alt-Pagedown Scroll forward through this window's history

    Shift-F2 Split the screen horizontally

    Ctrl-F2 Split the screen vertically

    Shift-F3 Move focus to the next split

    Shift-F4 Move focus to the previous split

    Shift-F5 Collapse all splits 

    Ctrl-F5  Reconnect any SSH/GPG sockets or agents

    Shift-F12 Toggle all of Byobu's keybindings on or off

 

显示git分支

  在软件开发中,git是一个非常优秀的版本管理工具,在实际应用中我们经常需要提交个人的程序代码,因此显示个人的git分支能在应用给我提供不少便利。

        在.bashrc中加入语句:

 

终端快速检索历史命令

  在应用Linux的过程中,经常需要快捷浏览历史命名,即输入部分字符即可达到所需命令,例如操作mvn clean install -Djavadoc.skip=true, mvn clean deploy -Dmaven.test.skip=true等。

        为了能在bash中采用Up以及Down自动补全,可以按如下操作:

        1)  在home下配置 " .inputrc " 文件,输入如下内容:

  $include /etc/inputrc
  "e[A": history-search-backward
  "e[B": history-search-forward
  #set editing-mode vi

   2) 也可以在.bashrc中进行绑定:

  bind '"e[A": history-search-backward'
  bind '"e[B": history-search-forward'

Vim便捷操作

    1) The ultimate vim distribution:https://github.com/spf13/spf13-vim

       2) Climate is the ultimate command line tool for Linux:https://github.com/adtac/climate

      具体内容请参考上述网址,在此不再详细介绍了。

     


  作者:志青云集
  出处:http://www.cnblogs.com/lyssym
  如果,您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】。
  如果,您希望更容易地发现我的新博客,不妨点击一下左下角的【关注我】。
  如果,您对我的博客所讲述的内容有兴趣,请继续关注我的后续博客,我是【志青云集】。
  本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则将依法追究法律责任。


 

原文地址:https://www.cnblogs.com/lyssym/p/6686588.html