Linux命令學習筆記(五) 學習命令

2021-08-21 02:46:14 字數 2437 閱讀 4447

[ftt@localhost ~]$ man ls  //man(manual),man page 是「手冊頁面」,該指令顯示ls命令各個方面的資訊。

//已知名稱,查詢功能

[ftt@localhost ~]$man -fls

ls (1)               - 列目錄內容

ls (1p)              - list directory contents

[ftt@localhost ~]$whatisls//該指令比man -f更常用

ls (1)               - 列目錄內容

ls (1p)              - list directory contents

//-w(wildcard),進行統配查詢man資料庫

[ftt@localhost ~]$ whatis -w ls*

ls (1)               - 列目錄內容

lsattr (1)           - (未知的主題)

lsearch (3tcl)       - 檢視乙個列表是否包含乙個特定的元素

lsort (3tcl)         - 給乙個列表的元素排序

lspci (8)            - 列出所有pci裝置

//-r(regex)可以和正規表示式一起使用

[ftt@localhost ~]$ whatis -r ^rm.*

rm (1)               - 移除檔案或者目錄

rmdir (1)            - (未知的主題)

//基於功能搜尋命令

man -k list

等同於 apropos list,apropos 後可以跟選項 -w或-r

apropos -e list,-e(exact)精準查詢

info info //進入「資訊頁面」,

[ftt@localhost ~]$whereisshotwell //whereis查詢可執行程式,它的原始檔(如果存在),手冊頁面路徑

shotwell: /usr/bin/shotwell /usr/lib64/shotwell /usr/libexec/shotwell /usr/share/shotwell /usr/share/man/man1/shotwell.1.gz

[ftt@localhost ~]$whereis -bshotwell //搜尋二進位制檔案路徑

shotwell: /usr/bin/shotwell /usr/lib64/shotwell /usr/libexec/shotwell /usr/share/shotwell

[ftt@localhost ~]$whereis -mshotwell //搜尋手冊頁面路徑

shotwell: /usr/share/man/man1/shotwell.1.gz

[ftt@localhost ~]$whereis -sshotwell //搜尋原始檔路徑

shotwell:[ftt@localhost ~]$which shotwell //whereis -b shotwell搜尋出兩個可執行檔案,which可搜尋出先執行哪個檔案

/usr/bin/shotwell

[ftt@localhost ~]$ which -a shotwell//搜尋命令的所與位置同whereis -b

/usr/bin/shotwell

/bin/shotwell

揭示shell如何解釋命令

[ftt@localhost ~]$ type ls

ls 是 `ls --color=auto' 的別名

[ftt@localhost ~]$ type cd

cd 是 shell 內嵌

//type -t顯示bash如何對待每個命令

共有5種可能:

(2)builtin:內置於bash中且自身直接執行的命令,與呼叫外部程式相對。內建函式的勢力有alias/cd/echo/history/source/type。

(3)file:未內置於shell的命令,該命令於外部呼叫。

(4)function:由linux,軟體或使用者建立的函式。與別名類似,type也會輸出函式的實際內容。

(5)keyword:僅由bash使用的保留字,如do/for/if/then/while和!。

[ftt@localhost ~]$ type -t ls

alias

[ftt@localhost ~]$ type -t pwd

builtin

Linux命令學習 gzip gunzip命令

gzip是linux上用於壓縮檔案和解壓字尾為.gz檔案的命令。gunzip就是gzip的硬連線,用於解壓被gzip壓縮的.gz檔案。所以gzip命令壓縮檔案和解壓.gz檔案可以完全搞定,gunzip只是為解壓.gz檔案提供了另一種選擇。gzip acdfhllnnqrtvv s 壓縮字尾字串 壓縮...

Linux學習筆記 五 使用者管理命令

4.5 使用者管理命令 命令名稱 useradd 命令所在路徑 usr sbin useradd 執行許可權 root 語法 useradd 使用者名稱 功能描述 新增新使用者 範例 useradd yangmi 命令名稱 passwd 命令所在路徑 usr bin passwd 執行許可權 所有使...

Linux學習筆記五

網路管理 ifconfig 檢視網絡卡資訊 ifconfig up 啟用網絡卡 ifconfig down 停止網絡卡 ifconfig eth0 網路ip 位址 netmask 子網掩碼 設定網絡卡的ip 位址和子網掩碼 ifconfig eth0 0 ip位址 增加一塊虛擬網絡卡為eth0 0 ...