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

首頁 > 系統 > Linux > 正文

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

2020-07-10 11:38:23
字體:
來源:轉載
供稿:網友

  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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 平山县| 自贡市| 信宜市| 乌鲁木齐市| 井研县| 富蕴县| 峡江县| 措美县| 阆中市| 会理县| 阳西县| 衡阳市| 栖霞市| 清水河县| 内丘县| 临沧市| 邳州市| 霍城县| 乃东县| 五河县| 阿勒泰市| 澎湖县| 茶陵县| 南皮县| 淳化县| 全椒县| 武平县| 建阳市| 红河县| 汕尾市| 射阳县| 宽城| 贡觉县| 任丘市| 定兴县| 富锦市| 措勤县| 和政县| 左云县| 万年县| 伊春市|