LinuxQuestions.org
Visit Jeremy's Blog.
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 01-16-2016, 09:04 AM   #1
sunny singhal
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Rep: Reputation: Disabled
mv files with specific date/time and count


Hi, I am trying to move a batch of files from 1 folder to another with specific date/time and count. Date and time option is working fine but not head(for count). Please help, I have below command to start with:

Below command is working fine for Date and time, but not sure how can I use it for copying only first 10 files.

find . -type f -newermt "2016-01-16 02:00:00" ! -newermt "2016-1-16 03:00:00" -exec mv '{}' /tmp/sunny/ \;
 
Old 01-16-2016, 09:09 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by sunny singhal View Post
Hi, I am trying to move a batch of files from 1 folder to another with specific date/time and count. Date and time option is working fine but not head(for count). Please help, I have below command to start with:

Below command is working fine for Date and time, but not sure how can I use it for copying only first 10 files.

find . -type f -newermt "2016-01-16 02:00:00" ! -newermt "2016-1-16 03:00:00" -exec mv '{}' /tmp/sunny/ \;
[untested]:
Code:
mv `find . -type f -newermt "2016-01-16 02:00:00" ! -newermt "2016-1-16 03:00:00" | head` /tmp/sunny/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Copy all Files and Folders from specific date? moviecarpet Linux - Newbie 4 05-26-2011 07:01 PM
IsThere a fridge, that we can program at specific date/time to unfreeze specific food frenchn00b General 3 07-21-2009 11:26 PM
How to create an executable script that starts execution at a specific date and time? jtag Linux - General 3 08-12-2008 08:36 PM
ow do I delete all files which were created on a specific date marsguy Linux - General 9 08-21-2007 08:15 AM
Copying files from a specific date dman65 Linux - Software 3 09-22-2003 10:16 AM

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

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