Skip to content

Instantly share code, notes, and snippets.

@Preetam
Created April 10, 2016 21:00
Show Gist options
  • Save Preetam/a657bbd393b7d088c75bbdf7fa6cb610 to your computer and use it in GitHub Desktop.
Save Preetam/a657bbd393b7d088c75bbdf7fa6cb610 to your computer and use it in GitHub Desktop.
Sort files in bash by number with a prefix
∂ migrations (change-schema): ls | sort -n -t - -k 2
update-1.sql
update-99.sql
update-100.sql
update-123.sql
update-1000.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment