Pages

Wednesday, May 9, 2012

ls order by time

Sort by time newest first

[[email protected] log]# ls -lt
total 3788
-rw------- 1 root root 153211 Dec 21 13:20 cron
-rw------- 1 root root 3725 Dec 21 13:06 secure
-rw------- 1 root root 20864 Dec 21 13:06 messages
-rw-r----- 1 mysql mysql 8641 Dec 21 13:06 mysqld.log
-rw-r--r-- 1 root root 11462 Dec 21 13:06 yum.log
drwxrwxr-x 2 tomcat tomcat 4096 Dec 21 13:05 tomcat5
-rw------- 1 root utmp 379008 Dec 21 13:05 btmp
-rw-rw-r-- 1 root utmp 35712 Dec 21 13:05 wtmp
-rw------- 1 root root 0 Dec 21 13:04 faillog
-rw------- 1 root root 0 Dec 21 13:04 tallylog
-rw-r--r-- 1 root root 2921168 Dec 21 13:01 lastlog
-rw------- 1 root root 5869 Dec 20 01:00 rkhunter.log
-rw------- 1 root root 0 Dec 19 03:20 boot.log
-rw------- 1 root root 0 Dec 19 03:20 maillog
drwxrwsr-x 2 root mailman 4096 Dec 19 03:20 mailman
-rw------- 1 root root 0 Dec 19 03:20 spooler
drwxr-x--- 2 sso root 4096 Dec 19 03:20 sso
-rw------- 1 root root 443960 Dec 19 03:20 cron.1
-rw------- 1 root root 5239 Dec 17 17:04 secure.1

Sort by time newest last
[[email protected] log]# ls -ltr
total 3788
-rw-r--r-- 1 root root 0 Jun 25 15:00 dmesg
drwxr-xr-x 2 apache apache 4096 Jun 25 15:07 atmail
drwxr-xr-x 2 root root 4096 Jun 28 03:56 mail
-rw-r--r-- 1 root root 0 Jul 26 05:15 xferlog
-rw-rw-r-- 1 root utmp 1288320 Aug 25 03:14 wtmp.1
drwx------ 2 root root 4096 Aug 30 12:32 httpd
drwxr-x--- 2 apache apache 4096 Sep 2 03:20 psa-horde
drwx------ 2 root root 4096 Sep 15 04:46 samba
-rw------- 1 root root 0 Nov 21 03:20 spooler.4
-rw------- 1 root root 0 Nov 21 03:20 secure.4
-rw------- 1 root root 0 Nov 21 03:20 maillog.4
-rw------- 1 root root 0 Nov 21 03:20 boot.log.4
-rw------- 1 root root 4407 Nov 27 13:58 messages.4
-rw------- 1 root root 443981 Nov 28 03:20 cron.4
-rw------- 1 root root 0 Nov 28 03:20 spooler.3
-rw------- 1 root root 0 Nov 28 03:20 maillog.3
-rw------- 1 root root 0 Nov 28 03:20 boot.log.3
-rw------- 1 root root 1153 Dec 2 16:41 secure.3
-rw------- 1 root root 6841 Dec 4 19:38 messages.3

No comments:

Post a Comment