ll命令
ll命令顯示的引數

如下是對每一列的引數的解釋
-
第一列為檔案型別

引數符號 型別 "-" 普通檔案 "d" 是個目錄檔案 "l" 鏈接檔案 "p" 管道檔案 "b" 設備檔案 "c" 字符設備檔案 "s" 套接字檔案 -
普通檔案型別
最常使用的一類檔案,其特點是不包含有檔案系統資訊的結構資訊,通常用戶所接觸到的檔案,比如圖形檔案、資料檔案、檔案檔案以及聲音檔案都屬于這種檔案,這種型別的檔案是按照其內部結構又可分為純文本檔案(ASCII)、二進制檔案(binary)、資料格式的檔案(data)、各種壓縮檔案,
- 純文本檔案(ASCII):這是Unix系統中最多的一種檔案型別,之所以稱為純文本檔案,是因為內容可以直接讀到的資料,例如數字、字母等等,設 置檔案幾乎都屬于這種檔案型別,舉例來說,使用命令“cat ~/.bashrc”就可以看到該檔案的內容(cat是將檔案內容讀出來),
- 二進制檔案(binary):系統其實僅認識且可以執行二進制檔案(binary file),Linux中的可執行檔案(腳本,文本方式的批處理檔案不算)就是這種格式的,舉例來說,命令cat就是一個二進制檔案,
- 資料格式的檔案(data):有些程式在運行程序中,會讀取某些特定格式的檔案,那些特定格式的檔案可以稱為資料檔案(data file),舉例來說,Linux在用戶登入時,都會將登錄資料記錄在 /var/log/wtmp檔案內,該檔案是一個資料檔案,它能通過last命令讀出來,但使用cat時,會讀出亂碼,因為它是屬于一種特殊格式的檔案,
-
目錄檔案型別
用于存放檔案名以及其相關資訊的檔案,是內核組織檔案系統的基本節點,目錄檔案可以包含下一級檔案目錄或者普通檔案,在Linux中,目錄檔案是一種檔案,
能用 # cd 命令進入的,
-
塊設備檔案型別
塊設備檔案 : 就是存盤資料以供系統存取的介面設備,簡單而言就是硬碟,例如一號硬碟的代碼是 /dev/hda1等檔案,
-
字符設備型別
字符設備檔案:即串行埠的介面設備,例如鍵盤、滑鼠等等,
-
套接字檔案型別
這類檔案通常用在網路資料連接,可以啟動一個程式來監聽客戶端的要求,客戶端就可以通過套接字來進行資料通信,
-
管道檔案型別
是一種很特殊的檔案,主要用于不同行程的資訊傳遞,當兩個行程需要進行資料或者資訊傳遞時,可以使用通道檔案,一個行程將需要傳遞的資料或者資訊寫入管道的一端,另一行程從管道的另一端取得所需要的資料或者資訊,通常管道是建立在調整快取中,
-
鏈接檔案型別
是一種特殊檔案,指向一個真實存在的檔案鏈接,類似于Windows下的快捷方式,鏈接檔案的不同,又可分為硬鏈接檔案和符號鏈接檔案,
-
檔案屬性

gss目錄的檔案屬性是
[rwx][r-x][r-x]分成三段第一段表示檔案創建者/所有者對該檔案所具有的權限, 第二段表示創建者/所有者所在的組的其他用戶所具有的權限, 第三段表示其他組的其他用戶所具有的權限,r(Read,讀取權限):對檔案而言,具有讀取檔案內容的權限;對目錄來說,具有瀏覽目錄的權限, w(Write,寫入權限):對檔案而言,具有新增、修改檔案內容的權限;對目錄來說,具有洗掉、移動目錄內檔案的權限, x(eXecute,執行權限):對檔案而言,具有執行檔案的權限;對目錄來說,該用戶具有進入目錄的權限,另外,這里還有2個很特殊的屬性,平時不怎么常見,這里也順帶解釋一下:
s或S(SUID,Set UID):可執行的檔案搭配這個權限,便能得到特權,任意存取該檔案的所有者能使用的全部系統資源,請注意具備SUID權限的檔案,黑客經常利用這種權限,以SUID配上root帳號擁有者,無聲無息地在系統中開扇后門,供日后進出使用,
t或T(Sticky):/tmp和 /var/tmp目錄供所有用戶暫時存取檔案,亦即每位用戶皆擁有完整的權限進入該目錄,去瀏覽、洗掉和移動檔案,
綜合起來可得,對于back_init檔案,其創建者/所有者具有可讀可寫可執行的權限,其創建者/所有者所在的組的其他用戶具有可讀可寫可執行的權限,其他組的其他用戶則具有可讀可執行但不可寫的權限, -
目錄或者鏈接個數

對于目錄檔案,表示它的第一級子目錄的個數,注意此處看到的值要減2才等于該目錄下的子目錄的實際個數,
比如這里的etc目錄下,其實是沒有子目錄的,所以應該是0,但是它這里卻顯示2,這是因為要加上.目錄和..目錄,在linux下,.目錄表示當前目錄,..目錄表示上一級目錄,

對于其他檔案,表示指向它的鏈接檔案的個數,
-
所有者及組

表示該檔案的所有者/創建者(owner)及其所在的組(group),
查看組的方法:
-
查看用戶:
cat /etc/passwd查看組:
cat /etc/group -
使用命令列groups 用戶名,,可以查看當前用戶所在組,以及組內其他成員的資訊

-
-
檔案大小

如果是檔案,則表示該檔案的大小,單位為位元組,
如果是目錄,則表示該目錄符所占的大小,并不表示該目錄下所有檔案的大小,查看檔案大小的命令
du -shdf -h(查看磁盤上的容量大小)ls -lht

-
最后修改日期

-
引數
[root@localhost Honeypot-deploy-steps]# ll --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
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
-b, --escape print C-style escapes for nongraphic characters
--block-size=SIZE scale sizes by SIZE before printing them; e.g.,
'--block-size=M' prints sizes in units of
1,048,576 bytes; see SIZE format below
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information);
with -l: show ctime and sort by name;
otherwise: sort by ctime, newest first
-C list entries by columns
--color[=WHEN] colorize the output; WHEN can be 'never', 'auto',
or 'always' (the default); more info below
-d, --directory list directories themselves, not their contents
-D, --dired generate output designed for Emacs' dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify append indicator (one of */=>@|) to entries
--file-type likewise, except do not append '*'
--format=WORD across -x, commas -m, horizontal -x, long -l,
single-column -1, verbose -l, vertical -C
--full-time like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files;
can be augmented with a --sort option, but any
use of --sort=none (-U) disables grouping
-G, --no-group in a long listing, don't print group names
-h, --human-readable with -l, print sizes in human readable format
(e.g., 1K 234M 2G)
--si likewise, but use powers of 1000 not 1024
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
that points to a directory
--hide=PATTERN do not list implied entries matching shell PATTERN
(overridden by -a or -A)
--indicator-style=WORD append indicator with style WORD to entry names:
none (default), slash (-p),
file-type (--file-type), classify (-F)
-i, --inode print the index number of each file
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN
-k, --kibibytes default to 1024-byte blocks for disk usage
-l use a long listing format
-L, --dereference when showing file information for a symbolic
link, show information for the file the link
references rather than for the link itself
-m fill width with a comma separated list of entries
-n, --numeric-uid-gid like -l, but list numeric user and group IDs
-N, --literal print raw entry names (don't treat e.g. control
characters specially)
-o like -l, but do not list group information
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars print ? instead of nongraphic characters
--show-control-chars show nongraphic characters as-is (the default,
unless program is 'ls' and output is a terminal)
-Q, --quote-name enclose entry names in double quotes
--quoting-style=WORD use quoting style WORD for entry names:
literal, locale, shell, shell-always, c, escape
-r, --reverse reverse order while sorting
-R, --recursive list subdirectories recursively
-s, --size print the allocated size of each file, in blocks
-S sort by file size
--sort=WORD sort by WORD instead of name: none (-U), size (-S),
time (-t), version (-v), extension (-X)
--time=WORD with -l, show time as WORD instead of default
modification time: atime or access or use (-u)
ctime or status (-c); also use specified time
as sort key if --sort=time
--time-style=STYLE with -l, show times using style STYLE:
full-iso, long-iso, iso, locale, or +FORMAT;
FORMAT is interpreted like in 'date'; if FORMAT
is FORMAT1<newline>FORMAT2, then FORMAT1 applies
to non-recent files and FORMAT2 to recent files;
if STYLE is prefixed with 'posix-', STYLE
takes effect only outside the POSIX locale
-t sort by modification time, newest first
-T, --tabsize=COLS assume tab stops at each COLS instead of 8
-u with -lt: sort by, and show, access time;
with -l: show access time and sort by name;
otherwise: sort by access time
-U do not sort; list entries in directory order
-v natural sort of (version) numbers within text
-w, --width=COLS assume screen width instead of current value
-x list entries by lines instead of by columns
-X sort alphabetically by entry extension
-1 list one file per line
SELinux options:
--lcontext Display security context. Enable -l. Lines
will probably be too wide for most displays.
-Z, --context Display security context so it fits on most
displays. Displays only mode, user, group,
security context and file name.
--scontext Display only security context and file name.
--help display this help and exit
--version output version information and exit
-a, --all 不隱藏任何以. 開始的專案
-A, --almost-all 列出除. 及.. 以外的任何專案
--author 與-l 同時使用時列出每個檔案的作者
-b, --escape 以八進制溢位序串列示不可列印的字符
--block-size=大小 塊以指定大小的位元組為單位
-B, --ignore-backups 不列出任何以"~"字符結束的專案
-c 配合-lt:根據ctime 排序并顯示ctime(檔案
狀態最后更改的時間)
配合-l:顯示ctime 但根據名稱排序 其他情況:按ctime 排序
-C 每欄由上至下列出專案
--color[=WHEN] 控制是否使用色彩分辨檔案,WHEN 可以是
"never"(默認)、"always"或"auto"其中之一
-d, --directory 當遇到目錄時列出目錄本身而非目錄內的檔案
-D, --dired 產生適合Emacs 的dired 模式使用的結果
-f 不進行排序,-aU 選項生效,-lst 選項失效
-F, --classify 加上檔案型別的指示符號(*/=@| 其中一個)
--format=關鍵字 交錯-x,逗號分隔-m,水平-x,長-l,
單欄-1,詳細-l,垂直-C
--full-time 即-l --time-style=full-iso
-g 類似-l,但不列出所有者
--group-directories-first
在檔案前分組目錄,此選項可與--sort 一起使用,
但是一旦使用--sort=none (-U)將禁用分組
-G, --no-group 以一個長串列的形式,不輸出組名
-h, --human-readable 與-l 一起,以易于閱讀的格式輸出檔案大小
(例如 1K 234M 2G)
--si 同上面類似,但是使用1000 為基底而非1024
-H, --dereference-command-line
跟隨命令列列出的符號鏈接
--dereference-command-line-symlink-to-dir
跟隨命令列列出的目錄的符號鏈接
--hide=PATTERN 隱藏符合PATTERN 模式的專案
(-a 或 -A 將覆寫此選項)
--indicator-style=方式 指定在每個專案名稱后加上指示符號方式:
none (默認),classify (-F),file-type (-p)
-i, --inode 顯示每個檔案的inode 號
-I, --ignore=PATTERN 不顯示任何符合指定shell PATTERN 的專案
-k 即--block-size=1K
-l 使用較長格式列出資訊
-L, --dereference 當顯示符號鏈接的檔案資訊時,顯示符號鏈接所指示
的物件而并非符號鏈接本身的資訊
-m 所有專案以逗號分隔,并填滿整行行寬
-n, --numeric-uid-gid 類似 -l,但列出UID 及GID 號
-N, --literal 輸出未經處理的專案名稱 (如不特別處理控制字符)
-o 類似 -l,但不列出有關組的資訊
-p, --indicator-style=slash 對目錄加上表示符號"/"
-q, --hide-control-chars 以"?"字符代替無法列印的字符
--show-control-chars 直接顯示無法列印的字符 (這是默認方式,除非呼叫
的程式名稱是"ls"而且是在終端輸出結果)
-Q, --quote-name 將條目名稱括上雙引號
--quoting-style=方式 使用指定的quoting 方式顯示條目的名稱:
literal、locale、shell、shell-always、c、escape
-r, --reverse 排序時保留順序
-R, --recursive 遞回顯示子目錄
-s, --size 以塊數形式顯示每個檔案分配的尺寸
-S 根據檔案大小排序
--sort=WORD 以下是可選用的WORD 和它們代表的相應選項:
extension -X status -c
none -U time -t
size -S atime -u
time -t access -u
version -v use -u
--time=WORD 和-l 同時使用時顯示WORD 所代表的時間而非修改時
間:atime、access、use、ctime 或status;加上
--sort=time 選項時會以指定時間作為排序關鍵字
--time-style=STYLE 和-l 同時使用時根據STYLE 代表的格式顯示時間:
full-iso、iso、locale、posix-iso、+FORMAT,
FORMAT 即是"date"所用的時間格式;如果FORMAT
是FORMAT1<換行>FORMAT2,FORMAT1 適用于較舊
的檔案而FORMAT2 適用于較新的檔案;如果STYLE
以"posix-"開頭,則STYLE 僅在POSIX 語系之外
生效,
-t 根據修改時間排序
-T, --tabsize=寬度 指定制表符(Tab)的寬度,而非8 個字符
-t 按修改時間排序
-T, --tabsize=COLS 指定制表符(Tab)的寬度,而非8個字符
-u 同-lt 一起使用:按照訪問時間排序并顯示
同-l一起使用:顯示訪問時間并按檔案名排序
其他:按照訪問時間排序
-U 不進行排序;按照目錄順序列出專案
-v 在文本中進行數字(版本)的自然排序
SIZE 可以是一個可選的整數,后面跟著以下單位中的一個:
KB 1000,K 1024,MB 1000*1000,M 1024*1024,還有 G、T、P、E、Z、Y,
使用色彩來區分檔案型別的功能已被禁用,默認設定和 --color=never 同時禁用了它,
使用 --color=auto 選項,ls 只在標準輸出被連至終端時才生成顏色代碼,
LS_COLORS 環境變數可改變此設定,可使用 dircolors 命令來設定,
ll -t 是降序, ll -t | tac 是升序
本文來自博客園,作者:ivanlee717,轉載請注明原文鏈接:https://www.cnblogs.com/ivanlee717/p/16271342.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/474568.html
標籤:其他
上一篇:使用NE555實作的延時開關電路
