linux常用命令

linux常用命令


(一)ls(list directory contents)

-l :長格式顯示(use a long listing format)

1. 文件類型(第1位)

b: 塊設備文件(block)

c: 字符設備文件(character)

d: 目錄文件(directory)

p: 命名管道文件(pipe)

l: 符號鏈接文件(symbolic link file)

s: 套接字文件(socket)

2. 文件權限(第2到10位)

3. 文件硬鏈接的次數

4. 文件的屬主

5. 文件的屬組

6. 文件大小(size)默認單位爲字節

7. 文件的時間戳(timestamp)

訪問時間(access)

修改時間(modify):改變文件的內容

改變時間(change):改變文件的屬性

[wuhui@localhost ~]$ ls -l
total 0
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Desktop
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Documents
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Downloads
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Music
drwxrwxr-x. 2 wuhui wuhui  6 Mar  5 21:45 perl5
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Pictures
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Public
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Templates
drwxr-xr-x. 2 wuhui wuhui  6 Mar  5 21:45 Videos

-h, --human-readable:以人容易懂的方式顯示,主要做單位轉換( with -l, print sizes in human readable format (e.g., 1K 234M 2G))

-a, --all:  顯示所有文件,包括以.開頭的隱藏文件(do not ignore entries starting with .)

-d, --directory:  顯示目錄自身屬性(list directories themselves, not their contents)

-i, --inode:顯示文件的索引節點號 (print the index number of each file

· -r, --reverse:逆序顯示文件(reverse order while sorting)

-R, --recursive:遞歸顯示文件


(二)cd(Change the shell working directory.

cd -:  在當前目錄和前一目錄之間切換

cd ~USERNAME: 進入指定用戶的家目錄,缺省狀態下進入當前用戶的家目錄


(三)type(Display information about command type.

命令類型:

內置命令(shell 內置)

外部命令(在文件系統的某個路徑下有一個與命令名稱相應的可執行文件)


(四)date( print or set the system date and time.

               linux主機上上存在兩個時間,系統時間和硬件時間。我們可以通過date命令查看系統時間,clock命令查看硬件時間。硬件時間是指主板上BIOS的時間,一般是由主板上的鈕釦電池供電維持的,系統在開機時讀取這個時間,並根據它來設定系統時間。

hwclock -w: 將系統時間同步到硬件

hwclock -s: 將硬件時間同步到系統


(五)獲取命令幫助

1) help

內部命令:help COMMAND   如:help cd

外部命令:COMMAND --help   如:ls --help

2)  man (an interface to the on-line reference manuals)

man 手冊一共分爲8個章節

1. 用戶命令(Executable programs or shell commands)

2. 系統調用System calls (functions provided by the kernel)

3. 庫調用(Library calls (functions within program libraries))

4. 特殊文件(Special files (usually found in /dev))

5. 文件格式(File formats and conventions eg /etc/passwd)

6. 遊戲(Games)

7. 雜項(Miscellaneous  (including  macro  packages  and  conventions), e.g. man(7), groff(7))

8. 管理命令(System administration commands (usually only for root))

3) info(read Info documents)

(六)man(an interface to the on-line reference manuals)

特殊符號說明:

<>: 必選項

...: 可以重複多次

[]: 可選,可省

|: 多選一

{}: 分組

關鍵字說明:

NAME: 命令名稱及功能簡要

SYNOPSIS: 用法說明,包括可用的選項

DESCRIPTION:命令功能的詳細說明,可能包括每一個選項的說明

OPTIONS:說明每一個選項的意義

FILES:此命令相關的配置文件

EXAMPLES:使用示例

 SEE ALSO: 另外參照

使用說明:

翻頁:

後翻:space

前翻:b

下一行:enter

上一行:k


查找:(默認不區分大小寫)

/keyword: 從前向後

?keyword: 從後向前

n: 下一個

N: 前一個

q: 退出














發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章