Skip to content

Instantly share code, notes, and snippets.

@haoliplus
Created March 14, 2016 02:28
Show Gist options
  • Save haoliplus/6b5507e45f816796d08b to your computer and use it in GitHub Desktop.
Save haoliplus/6b5507e45f816796d08b to your computer and use it in GitHub Desktop.
get file path or dir path using dirname and basename
var=/path/to/file.postfix
$(basename $var) # file.postfix
$(basename $var .postfix) # file
$(dirname $var) /path/to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment