Skip to content

Instantly share code, notes, and snippets.

@jeffjohnson9046
Created November 7, 2014 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffjohnson9046/aa7b24d83144dcaae491 to your computer and use it in GitHub Desktop.
Save jeffjohnson9046/aa7b24d83144dcaae491 to your computer and use it in GitHub Desktop.
Sort a List of Files and Cat Them Together
# The command below will take a list of files in the current directory, sort them and cat them together into a single file.
# The files against which this command was initially used were all named using the following convention:
#
# V[some number]__[the name of the file].sql
cat `ls -1 *.sql | sort -k1.2n` > /tmp/migration.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment