shell 在計算機科學中,Shell俗稱殼,用來區別Kernel(核)html
Shell分類:
1:圖形界面shell:經過提供友好的可視化界面,調用相應應用程序,如windows系列操做系統,Linux系統上的圖形化應用程序GNOME、KDE等。
2:命令行shell:經過鍵盤輸入特定命令的方式,調用相應的應用程序,
windows系統的cmd.exe、Windows PowerShell,Linux系統的Bourne shell ( sh)、Bourne Again shell ( bash)等。shell
bash這個shell:
bash命令格式
命令 -options 命令 --help
-後面跟着的是單詞的簡寫形式;
--後面跟着的是單詞的全名windows
bash常見命令
a: pwd (Print Working Director) 查看當前目錄
b: cd(Change Directory)切換目錄 eg: cd /etc
c: ls (List) 查看當前目錄下的內容 eg:ls -al查看所有(all)列表(list)形式的內容;
d: mkdir (Make Directory)建立目錄 eg:mkdir blog
e: touch 建立文件,eg:touch index.html
f: cat: 查看文件所有內容, eg:cat index.html
g: less 查看文件 分頁查看的效果 (q(quit)退出查看)eg:more/etc/passwd、less/etc/passwd
h: rm (remove) 刪除文件 eg:rm index.html
i: rmdir (Remove Directory)刪除文件夾,只能刪除空的文件夾,不經常使用,毫無心義;
刪除不爲空的文件夾方法:rm -r 文件名稱(利用遞歸)
j:mv (move)移動文件或重命名,eg:mv index.html demo/index2.html 將index.html移動到demo文件夾下並重命名爲index2.html
k:cp (copy) 複製文件 eg:cp index.html
l:tab 自動補全,連續兩次會將全部匹配內容顯示出來
m:>和>>重定向 ,eg: echo hello world!>README.md, >覆蓋>>追加bash