[tyang3@localhost Desktop]$ command [-options] [arguments]
指令 選項 參數(shù)
command 命令:表示命令的名稱,如 ls、cd、cp等
options 選項:定義命令的執(zhí)行特性,中刮號[]并不存在亍實際的指令中,而加入選項設(shè)定時,通常選項前會帶 - 號或--號,有兩種長短選項
短選項:用-引導(dǎo),后面跟單個字符,如 -a、-l、-h等
多個短選項可以組合使用,效果和幾個短選項一樣,如-a –l -h===-alh
長選項:用--引導(dǎo),后面跟完整的單詞,如—help
arguments 參數(shù):表示命令的作用對象,可以有多個參數(shù),通常情況可以是文件名、目錄、或用戶名。
說明一:指令中第一個輸入的部分絕對是『指令(command)』或者是『可執(zhí)行文件案』
說明二:命令, 選項, 參數(shù)等這幾個咚咚中間以空格來區(qū)分,不論空幾格 shell 都規(guī)為一格
[tyang3@localhost Desktop]$ ls -al /etc
[tyang3@localhost Desktop]$ ls -al /etc
[tyang3@localhost Desktop]$ ls -a -l /etc
這三個命令效果完全一樣
說明三:指令太長的時候,可以使用反斜杠 (\) 來跳脫[Enter]符號,使指令連續(xù)到下一行。 注意!反斜杠后就立刻接特殊字符,才能跳脫!
說明四:在Linux系統(tǒng)中,嚴(yán)格區(qū)分英文字母大小寫,如cd和CD并不同
二、幫助命令 1. whatis command>:顯示簡短功能描述
[tyang3@localhost Desktop]$ whatis ls
ls (1) - list directory contents
ls (1p) - list directory contents
2. command> --help:顯示使用摘要和參數(shù)列表(可以查看大多數(shù)命令的用法)
[tyang3@localhost Desktop]$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
3. Man [chapter>] command>:查看命令描述或手冊頁(Manual)
[tyang3@localhost Desktop]$ man ls
在man命令下底行模式:輸入
/text> 查找關(guān)鍵字
n/N 下一個/上一個
q 離開
man -k keyword> 列出包含keyword關(guān)鍵字的手冊頁
4. Info command>:查看命令更詳細的說明文件
[tyang3@localhost ~]$ info ls
注:info查看的是比man更詳細的說明,也就是把man的頁再劃分為更小的章節(jié),同時這個命令還可以鏈接到相似主題
info命令底行模式:
pageUp.pageDown 翻頁
Tab 跳往下一個鏈接(有*的地方)
Enter 進入鏈接
n/p/u 跳往下一個(上一個)小節(jié),上一層章節(jié)
s[text>] 查找關(guān)鍵字
q 離開
在查看命令幫助時,會出現(xiàn)[],>,|等符號,它們的含義如下:
[] 表示是可選的;
> 表示是可變化的;
x|y|z 表示只能選擇一個;
-abc 表示三個參數(shù)(或任何二個)的混合使用
usr/share/doc/ 說明文件目錄
http://www.redhat.com/docs/ 在線說明文件