Skip to content

Instantly share code, notes, and snippets.

@rahul286
Last active March 21, 2017 12:31
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 rahul286/c6325f51294a1cdc4a7d5f877aefcba4 to your computer and use it in GitHub Desktop.
Save rahul286/c6325f51294a1cdc4a7d5f877aefcba4 to your computer and use it in GitHub Desktop.
sed extract numbers from filename

Sample file names from wp-cli export example.wordpress.2017-03-03.988.xml

ls -1 | sed 's/example.wordpress.[0-9]*-[0-9]*-[0-9]*.\([0-9]*\).xml$/\1/' 

Extracts 998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment