basename Linux Command

Started by sukishan, Aug 14, 2009, 08:09 PM

Previous topic - Next topic

sukishan

basename
basename name [suffix] basename option

Remove leading directory components from a path. If suffix is given, remove that also. The result is printed to standard output. This is useful mostly in a script when you need to work with a filename but can't predict its full path in every instance.

Options
--help
Print help message and then exit.

--version
Print the version number and then exit.

Examples
$ basename /usr/lib/libm.a libm.a $ basename /usr/lib/libm.a .a libm
A good beginning makes a good ending

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S post or ALT+P preview