LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2004, 09:57 PM   #1
suguru
Member
 
Registered: Dec 2003
Location: Voluntarily move into diaster relief areas.
Distribution: Upgraded from Suse 10 to Ubuntu.
Posts: 104

Rep: Reputation: 15
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
 
Old 02-18-2004, 10:27 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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 {} \;
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow a user to use gaim only at a certain time of the day Menestrel Linux - Security 5 07-04-2005 12:30 AM
Multicount in PHP , displays visits on current day, week, month, year and total visit xbaez Programming 1 04-24-2005 02:50 AM
time of day problem gw1500se Mandriva 9 03-23-2004 09:25 AM
contrlling login by day and time starx Linux - General 1 12-07-2003 03:24 PM
Its that time of year again! Nominate LQ.org CragStar General 6 11-03-2002 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration