LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   ls sometimes year sometimes the time of day (http://www.linuxquestions.org/questions/linux-software-2/ls-sometimes-year-sometimes-the-time-of-day-147837/)

suguru 02-18-2004 09:57 PM

ls sometimes year sometimes the time of day
 
I am running from a knx-hdinstall knoppix 3.3
ls -ls sometimes gives a year and sometimes the time of day in
the 9th field. Here is a cut from
ls -ls /etc | sort -k 7 -k9
4 -rw-r--r-- 1 root root 48 Feb 17 08:49 resolv.conf~
1 drwxr-xr-x 6 root root 248 Feb 17 09:00 network
4 -rwxr-xr-x 1 root root 1074 Feb 18 2003 auto.net
4 -rw-r--r-- 1 root root 199 Feb 18 2004 mtab
4 -rw-r--r-- 1 root root 46 Feb 18 19:22 adjtime
4 -rw------- 1 root root 36 Feb 18 20:17 ioctl.save
4 -rw-r--r-- 1 root root 165 Feb 18 20:17 printcap.cups
1 drwxrwxr-x 6 root dip 576 Feb 18 20:27 ppp
4 -rw-r--r-- 1 root root 276 Feb 20 2001 stinit.def
1 drwxr-xr-x 4 root root 96 Feb 24 2003 perl
1 drwxr-xr-x 2 root root 48 Feb 24 2003 shaper

What causes this inconsistency?
How can I do it better?
How can I easily locate all files modified in the last x days?
Thanks, suguru

homey 02-18-2004 10:27 PM

I don't know what is causing the inconsistancy on your machine but you may have better luck with the find utility. For example, this will find all html files in my home directory with a modification time of more than 2 days ago. If I used the -2 it would list files with a modification time of less than 2 days.


find /home/* -type f -name '*.html' -mtime +2 -exec ls {} \;


All times are GMT -5. The time now is 09:56 AM.