LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-15-2009, 11:36 AM   #1
aayoub
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 0
Help with du script


I am trying to get a list of ftp users' folders and full date "mm-dd-yyyy" when they were changed.
I can get the list and of folders and their sizes largest first by using du commnad
du --max-depth=1 /ftproot/ftpusers | sort -n -r | more

2365580 /ftproot/ftpusers/user1
1330908 /ftproot/ftpusers/user2
826072 /ftproot/ftpusers/user3
549428 /ftproot/ftpusers/user4
285800 /ftproot/ftpusers/user5

Can I an add another switch to get the date as well, then seperate the list to active and inactive users. The inactive should contain any user that have not uploaded any files within the last 60 days (2 months.

Thank you in advance.
 
Old 04-15-2009, 11:50 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Please see man find
Pay particular attention to the -mtime n option:
Code:
−mtime n
       File’s data was last modified n*24 hours ago. See the comments for −atime to understand how
       rounding affects the interpretation of file modification times.
Welcome to LQ!
 
Old 04-15-2009, 12:25 PM   #3
aayoub
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you tredegar! can you provide an example?
 
Old 04-15-2009, 12:58 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
can you provide an example?
Well. No I can not (or rather I will not).

The solution is pretty simple - Educate yourself about linux commands and exactly how they work. Search, experiment, test and learn. You have already had a very big hint in my post #2.

I could give you the answer in one line, but then you would not have learnt anything, so you'll soon be back here with "Help me with ....", without you having done any work at all. This is just a lazy attitude, which isn't encouraged on these forums.

So: Get busy. Learn how linux commands work. Read the man pages. Test them out.

Once you can show you have tried to help yourself, you'll find many people here are happy to help you further. But YOU need to make a start for YOURSELF.

Is this "homework"?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a ssh script on Linux server from Windows through a bat script? wanna13e Programming 13 10-23-2009 02:41 AM
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 04:50 PM
set variables in a bash script; ansi PS1 color script donnied Programming 4 11-21-2007 11:33 AM
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 09:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:27 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