Computing.Net > Forums > Unix > List files newer than 10 days

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

List files newer than 10 days

Reply to Message Icon

Name: Siow Wei
Date: January 6, 2003 at 19:51:52 Pacific
OS: Win 2000
CPU/Ram: 256
Comment:

Hi all,
I manage to list files in long listing by time last modified and starting with 'N":
ls -lt |grep N
Can I know how to list files that are newer than 10 days?
And also, how to find files that have less than 2 links?
Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: January 7, 2003 at 06:23:54 Pacific
Reply:

1) find . -mtime -10

2) the number of links is represent in the second column of ls -l. Check the man page on ls for os specifics.


0

Response Number 2
Name: Siow Wei
Date: January 7, 2003 at 16:20:04 Pacific
Reply:

Yeah, got it. Thanks a lot!!
However, if I have to list the files that have less than 2 links, what is the command to use?


0

Response Number 3
Name: David Perry
Date: January 8, 2003 at 07:46:05 Pacific
Reply:

the number of links is represented by the second space delimited column in the output of ls -l


0

Response Number 4
Name: Frank
Date: January 9, 2003 at 01:34:46 Pacific
Reply:

Hi Siow,

you can try:

find . -mtime -10 -ls | while read a link rest
do
if [ "$link" -le 2 ]
then
echo $a $link $rest
fi
done

Have Fun
Frank


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: List files newer than 10 days

renaming files based on date arguments www.computing.net/answers/unix/renaming-files-based-on-date-arguments/2499.html

how to find files and move to direc www.computing.net/answers/unix/how-to-find-files-and-move-to-direc/4822.html

Rename files older than 2 days www.computing.net/answers/unix/rename-files-older-than-2-days/4185.html