LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 03-24-2007, 01:21 PM   #1
teco
LQ Newbie
 
Registered: Oct 2004
Location: Brazil
Distribution: RH, Fedora
Posts: 10

Rep: Reputation: 0
sort files


hi,
I need do a scan into my fileserver, and I want that the output goes to a file, then I can built a grafic line with the informmations.

I need do a sort file by their last access, like this:
files that have been accessed into 30days, 30 to 90, 90 to 365 and so one, I need this in order to know how long a file have not been acessed and how much space it consume.

Another sort should be: sort files by their time modification, I need know how much files people handle (make changes) into 30 days, 30 to 90days ...etc..

Please may you help on this?
I know that is something possible with ls command, but I could understand so goot the parameters..

Another nice statistic would be the duplicate files into my file server..
I'm using Fedora distro.
 
Old 03-25-2007, 01:58 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,165

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Probably the easiest way to do this is with find, e.g. to find all files in directory /foo and its subdirectories) that have been modified more than 10 days ago:

find /foo -mtime +10 -print

If you want to see how much space the file is taking up substiture -ls for -print in the above command, which will give you output like ls -lids for each file it finds. The field right before the modification date is the size of the file. You can also direct find to report files having a certain size with the -size option. You should read the man page for find -- there are a lot of options which you should find helpful.
 
Old 03-25-2007, 05:31 PM   #3
teco
LQ Newbie
 
Registered: Oct 2004
Location: Brazil
Distribution: RH, Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by btmiller
Probably the easiest way to do this is with find, e.g. to find all files in directory /foo and its subdirectories) that have been modified more than 10 days ago:

find /foo -mtime +10 -print

If you want to see how much space the file is taking up substiture -ls for -print in the above command, which will give you output like ls -lids for each file it finds. The field right before the modification date is the size of the file. You can also direct find to report files having a certain size with the -size option. You should read the man page for find -- there are a lot of options which you should find helpful.
THANKS A LOT
 
  


Reply

Tags
files, ls, sort


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
bash sort files by date in file name thedude2010 Programming 6 05-12-2006 12:07 PM
know how to sort files according to size marsguy Linux - General 2 04-01-2006 08:21 AM
bash script to sort files by extension otheralex Programming 7 08-19-2005 03:40 AM
Command line to sort files satimis Programming 6 06-28-2005 03:50 AM
sort files after size Ephracis Linux - Newbie 2 05-14-2005 05:44 PM


All times are GMT -5. The time now is 01:53 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration