One Day One Cmd

Place for playing with commands…

Day 73: $ basename command

ODOC: About basename

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 myfile.txt .txt

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

With Regards,
S. Praveen


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: