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 02-09-2016, 11:52 AM   #1
sunny singhal
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Rep: Reputation: Disabled
head command picking random files


Hi,

I am using below command for moving files from one folder to another on the basis of date/time/name/count pattern. My command works fine but only concern is head command picking random files, I want it to pick top 30 files on basis of creation date and time.

mv -v `find . -type f -newermt "2016-02-08 00:00:00" ! -newermt "2016-02-08 16:55:00" | xargs ls | grep 'INB' | head -n 30` /tmp >> out.txt

Can someone please help.
 
Old 02-09-2016, 12:11 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Please do not ask a second question based on the same details ... just add to your original question
 
  


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
[SOLVED] Parsing folders picking files and concatenating them jahndavik Programming 4 03-21-2014 10:29 AM
Is there a bash command for picking a random file? adanedhel728 Linux - General 5 10-24-2008 12:03 PM
KDE Random wallpaper or script to create symbolic links to random files cvelasquez Linux - Software 2 02-26-2007 06:48 PM
random picking scripts inside a script mrgreaper Linux - Newbie 5 06-13-2006 08:26 PM
Autotools kept picking wrong rule/files lucky6969b Programming 3 04-21-2006 04:58 AM

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

All times are GMT -5. The time now is 08:00 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
Open Source Consulting | Domain Registration