Skip to content

Instantly share code, notes, and snippets.

@ekiara
Created September 1, 2013 10:55
Show Gist options
  • Save ekiara/6403720 to your computer and use it in GitHub Desktop.
Save ekiara/6403720 to your computer and use it in GitHub Desktop.
Getting the last 'n' characters of a string
#!/bin/bash
#
# Getting the last 'n' characters of a string
# i.e. for getting the last 16 characters of all files (useful when dealing
# with Youtube downloads)
ls | awk '{print substr($0, length($0) - 15, length($0))}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment