
格式:ls [OPTION]… [DIR]…
. _9 G4 h+ N1 J z# }不加任何选项和路径为直接显示当前位置的文件列表9 \7 f+ g' c% R7 M+ o
- [root@localhost # ls
- anaconda-ks.cfg
- [root@localhost # pwd
- /root
- [root@localhost # ls /root/
- anaconda-ks.cfg
- [root@localhost # : d9 }- y+ f: Z" p% c! c& r4 A( o
" O% q$ W2 p A
-a,–all:显示所有文件,包括隐藏文件。- h6 [0 S8 ?; M- ]# A9 d+ n
- [root@localhost # ls -a
- . anaconda-ks.cfg .bash_logout .bashrc .tcshrc
- .. .bash_history .bash_profile .cshrc .viminfo
- [root@localhost # ls --all
- . anaconda-ks.cfg .bash_logout .bashrc .tcshrc
- .. .bash_history .bash_profile .cshrc .viminfo
- [root@localhost #% y, `3 B2 K1 t7 _ R M( K7 a# j* b
L0 P" h" O1 s( K B
-l:长格式模式显示文件的相关信息) |5 ^) E5 @4 A
- [root@localhost # ls -l
- total 4
- -rw-------. 1 root root 1301 Jun 22 00:53 anaconda-ks.cfg
- [root@localhost #
* D y/ v- ^% \1 _! k 系统默认有个别名命令为(ll=ls -l);简化命令的输入,按需使用。
: R# G3 H! O; r A7 F- [root@localhost # ll
- total 4
- -rw-------. 1 root root 1301 Jun 22 00:53 anaconda-ks.cfg
- [root@localhost # ls -l
- total 4
- -rw-------. 1 root root 1301 Jun 22 00:53 anaconda-ks.cfg
- [root@localhost #
]) {& y( z2 s& w# B7 | " ^9 [/ J) {) k. R
9 O' m; R+ D/ O% k7 O& [. h
' }. a) O& y7 m6 c0 w$ p' v# {* _
-h:单位换算,优化容量显示模式(和参数-l配套使用);当长格式显示文件信息时,文件的大小默认单位是字节,不便于查看,此参数把字节转换显示为KB。 e3 F) i- m/ n2 J1 b/ ~
- [root@localhost # ls -lh
- total 4.0K
- -rw-------. 1 root root 1.3K Jun 22 00:53 anaconda-ks.cfg
- [root@localhost # ( Q* X( G1 i5 L9 E. U( X
/ {# a+ b7 V5 j
-d:显示目录自身的相关信息(和参数-l配套使用)7 E3 {- h& Z# O0 D% l' ~% h8 c
- [root@localhost # ls -l /root/
- total 4
- -rw-------. 1 root root 1301 Jun 22 00:53 anaconda-ks.cfg
- [root@localhost # ls -ld /root/
- dr-xr-x---. 2 root root 4096 Jun 23 17:11 /root/
- [root@localhost #, O9 [; H$ w0 Y2 O
( z( K, C2 B& ^! a/ h" T& t0 l6 O# C2 Y8 o
|
|