LinuxQuestions.org
Help answer threads with 0 replies.
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 06-03-2008, 10:12 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
move file


hi im trying to move files older than 30 min a folder
find . -depth -type f -name '*' -mtime -1 -exec mv {} /home/folder
but its moving none i cant get the right command to get the time to check for files 30min old
 
Old 06-03-2008, 10:22 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
granularity is per day, not hour

mtime is n * 24 hours, not minutes. You'll need to use -mmin or write a shell script to get all files and check each file's date.
 
Old 06-03-2008, 10:24 AM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 532

Rep: Reputation: 78
Hi mahmoud,

Can you try that:
Code:
mv $( find . -depth -type f -name '*' -cmin +30 ) /YOUR/DESTINATION

Last edited by angel115; 06-03-2008 at 10:31 AM.
 
Old 06-05-2008, 08:59 AM   #4
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
cheers guys that helped
 
  


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
squirrel Could not move/copy file. File not attached mrlinux2000 Linux - Software 4 05-24-2010 03:41 AM
move file ust Linux - Software 4 12-24-2005 08:31 AM
move file ust Linux - Software 1 08-29-2005 04:06 AM
how to move a file to a different file system? iclinux Linux - Newbie 1 07-06-2005 10:42 AM
Re: possible to move file under /dev? raindrop Linux - General 5 11-14-2002 11:23 AM


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