Skip to content

Instantly share code, notes, and snippets.

@tsertkov
Created February 6, 2015 01:17
Show Gist options
  • Select an option

  • Save tsertkov/8bd1bd6bc663668e8fd1 to your computer and use it in GitHub Desktop.

Select an option

Save tsertkov/8bd1bd6bc663668e8fd1 to your computer and use it in GitHub Desktop.
Merge files by group pattern in current directogy
#/usr/bin/env bash
# Merge splitted files in current folder
files=$(ls | grep \\-chunk- | sed s/-chunk-.\*$// | uniq)
for file in $files; do
cat $file-chunk-* > $file && rm -f $file-chunk-*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment