Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> 關於Linux >> Linux Zsh命令使用實例

Linux Zsh命令使用實例

日期:2017/1/25 10:39:29      編輯:關於Linux

  在Linux系統中,通常使用的事都bash shell,所以很多用戶對Zsh不是很了解,下面小編就給大家分享一些Zsh命令的使用實例,以便你對Zsh有更深入的了解。

 Linux Zsh命令使用實例

  實例:

  1: 使用 ** 作為下級目錄的通配符:

  $ ls **/*.pyc

  foo.pyc bar.pyc lib/wibble.pyc

  $ rm **/*.pyc

  $ ls **/*.pyc

  2: 在文件篩選中使用匹配模式:

  $ ls *.(py|sh)

  3: 在文件篩選中使用修飾符,如:(@) 限制只匹配符號鏈接:

  $ ls -l *(@)

  4: 使用制表符TAB來自動完成,如man的時候:

  $ man zsh[TAB]

  5: 也可以用制表符來自動補全命令選項:

  $ python -[TAB]

  6: 或者在kill的時候自動完成:

  $ kill Dock[TAB]

  7: 在制表符自動補全時,可以使用光標鍵(上下左右等):

  $ man zsh[TAB][DOWN][RIGHT][LEFT][UP]

  8: 自動修改錯誤的輸入:

  $ pythn -V

  zsh: correct ‘pythn’ to ‘python’ [nyae]? y

  Python 2.7.1

  9: 使用r來重復上一條命令,可以帶替換方式!

  $ touch foo.htm bar.htm

  $ mv foo.htm foo.html

  $ r foo=bar

  mv bar.htm bar.html

  10: 高可定制性的提示符,使用RPROMPT居然可以設置提示符在右邊!

  $ RPROMPT=“%t”

  上面就是Linux Zsh命令操作實例的相關介紹了,如果你想要使用或了解Zsh的話,可是用apt-get、yum等進行安裝。

Copyright © Windows教程網 All Rights Reserved