Skip to content

Instantly share code, notes, and snippets.

@ramananbalakrishnan
Last active August 29, 2015 14:26
Show Gist options
  • Save ramananbalakrishnan/89a60b116d6e72064e52 to your computer and use it in GitHub Desktop.
Save ramananbalakrishnan/89a60b116d6e72064e52 to your computer and use it in GitHub Desktop.
Find all files modified within certain dates , sort them according to time, pick certain filenames and concatenate the gzipped files
cat `find ./ -newermt "2015-07-29 19:30" -not -newermt "2015-07-30 06:46" -type f -printf '%T@ %p\n' |\
sort -k1 -n |\
grep 'access.log.*.gz' |\
awk '{print $2}'` > ~/outputFile.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment