Unix 'Basename' command

The basename utility deletes any prefix ending in / and the suffix (if present in string) from string, and prints the
result on the standard output. It is normally used inside substitution marks (``) within shell procedures.


basename [string] [suffix]

string - the leading part of the path name or sting

suffix - additional remaining portion of name that if matches will be removed


basename myfile.txt .txt - Takes the basename of myfile.txt and strips the .txt portion and then just displays myfile.

credits to: http://www.computerhope.com/unix/ubasenam.htm


Popular posts from this blog

HIVE: Both Left and Right Aliases Encountered in Join

Assign select result to variable in Netezza stored procedure

Splitting value in Netezza using array_split