Skip to content

Instantly share code, notes, and snippets.

@BrendanThompson
Last active August 29, 2015 13:58
Show Gist options
  • Save BrendanThompson/10345945 to your computer and use it in GitHub Desktop.
Save BrendanThompson/10345945 to your computer and use it in GitHub Desktop.
This will get the file name when a full path is given.
i=0; cut -d '/' -f $(( $i + $(grep -o '/' <<< $FILE | grep -c .) )) <<< $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment