LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 12: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, 12:58 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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, 04: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:36 AM.

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