LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 12:52 PM   #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, 01:11 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,769

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


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

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

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