天天看點

linux的ls指令詳解(四)(幾種常用的ls選項排序指令)

-u選項  

 與-LT:排序,并顯示,通路時間;            

     帶l:顯示通路時間和按名稱排序;       

  否則:按通路時間排序

執行個體:

ls -u -lt

總用量 18040

drwxrwxrwx.  9 root     root          200 8月  31 18:29 apache-tomcat

-rw-r--r--.  2 root     root          173 8月  31 09:49 start1

-rw-r--r--.  2 root     root          173 8月  31 09:49 start4

-rw-r--r--.  1 root     root          189 8月  31 09:49 start0822

-rw-r--r--.  2 root     root           18 8月  31 09:49 s1

-rw-r--r--.  1 root     root          173 8月  31 09:49 s2

-rwxrwxrwx.  1 root     root            0 8月  26 13:09 start日志

讓我們來把ls -u -lt 和ls -lt作一個對比:

ls -lt

總用量 18040

drwxrwxrwx.  9 root     root          200 8月  30 12:34 apache-tomcat

-rw-r--r--.  1 root     root          173 8月  29 16:48 s2

-rw-r--r--.  2 root     root          173 8月  29 16:48 start1

-rw-r--r--.  2 root     root          173 8月  29 16:48 start4

-rw-r--r--.  2 root     root           18 8月  29 16:00 s1

-rwxrwxrwx.  1 root     root            0 8月  26 12:14 start日志

-rw-r--r--.  1 root     root          189 8月  26 11:59 start0822

ls -lt是以更新時間為順序使用較長格式列出資訊,包括檔案的權限資訊,檔案大小,作者,建立時間等。

-U(大寫)選項

-不排序;按目錄順序列出條目

執行個體:

ls -U

apache-tomcat.tar  bugzilla  LinuxVarLog-xiangjie.txt  start1

apache-tomcat      start0822       s1                        s2

bugzilla.tar        start日志       start4

繼續閱讀