Skip to content

Instantly share code, notes, and snippets.

@absynce
Last active October 27, 2016 18:21
Show Gist options
  • Save absynce/a17d29774ebf59f0895e9a648847399a to your computer and use it in GitHub Desktop.
Save absynce/a17d29774ebf59f0895e9a648847399a to your computer and use it in GitHub Desktop.
Move files in a directory based on file prefix
# TODO: make this a real shell script with variables, this is a one liner for a bash shell prompt.
ls | grep -oP '(?<=hx).*' | perl -ne 'print "hx$_ healthtrax$_"' | xargs -n 2 git mv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment