国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

lixux系統中bash命令下一些操作技巧 學會后可事半功倍

2020-06-13 11:46:00
字體:
來源:轉載
供稿:網友

  tab鍵補全用法

  當我們敲擊一下tab補全命令或文件名

  當我們敲擊兩下tab 列出相關的所有可選項

  cd -   相當于電視的回看

  有時候我們進入一個非常長的目錄,后來又進入另一個目錄,可能我們還行回到原來那個長,如果事先知道,我們可能輸入pwd ,以便一會兒粘貼,有時候忘了輸入pwd我們可能無奈還得輸入一次長長的路徑,我們可以輸入一下cd -試試,直接回到上次進入的目錄,就像是看電視時候的回看按鈕。是不是很好用?

  查看以下例子

  [root@localhost /]# cd /tmp

  [root@localhost tmp]# pwd

  /tmp

  [root@localhost tmp]# cd /

  [root@localhost /]# pwd

  /

  [root@localhost /]# cd -

  /tmp

  [root@localhost tmp]# pwd

  /tmp

  Esc+.

  用法舉例

  首先touch一個文件,然后編輯這個文件

  touch abcdefghijk

  敲入vi ,然后Esc+. 發現是不是abcdefghijk已經出現在vi后面/  

   轉義字符用法

  系統中一些命令都是別名的功能,比如我們使用的rm、mv等,實際上是 rm -i和mv -i 。

  查看系統別名可以使用alias命令,例如以下系統默認的別名。

  [root@localhost testdir]# alias

  alias cp='cp -i'

  alias egrep='egrep --color=auto'

  alias fgrep='fgrep --color=auto'

  alias grep='grep --color=auto'

  alias l.='ls -d .* --color=auto'

  alias ll='ls -l --color=auto'

  alias ls='ls --color=auto'

  alias mv='mv -i'

  alias rm='rm -i'

  alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

  有時候我們刪一個文件時候,會出現以下提示,  需要我們一個個確認,原因就是rm默認就是rm -i起了作用。

  [root@localhost testdir]# cd dir1

  [root@localhost dir1]# ls

  file1  file2  file3  file4

  [root@localhost dir1]# rm file1 file2 file3 file4rm: remove regular empty file ?.ile1?. y

  rm: remove regular empty file ?.ile2?. y

  rm: remove regular empty file ?.ile3?. y

  rm: remove regular empty file ?.ile4?. y

  我們可以使用轉移字符使別名失效,使用如下,刪除就不會再有提示確認了。

  [root@localhost testdir]# cd dir1

  [root@localhost dir1]# ls

  file1  file2  file3  file4

  [root@localhost dir1]# /rm file1 file2 file3 file4


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泉州市| 长兴县| 和政县| 达日县| 兰坪| 兰州市| 屏东市| 巴里| 土默特左旗| 嘉定区| 化州市| 安溪县| 宾川县| 乾安县| 贡觉县| 辰溪县| 巫溪县| 砀山县| 万源市| 长沙县| 安陆市| 湘潭市| 堆龙德庆县| 长沙市| 临泉县| 崇义县| 沙洋县| 三亚市| 卢氏县| 改则县| 克拉玛依市| 凤阳县| 额济纳旗| 龙岩市| 高陵县| 体育| 漠河县| 项城市| 门源| 临桂县| 安新县|