Linux basename Command

In this tutorial we learn how to use basename commmand in Linux. basename command is basename - strip directory and suffix from filenames basename NAME [SUFFIX] basename OPTION… NAME…

What is Linux basename Command?

In this tutorial we learn how to use basename command in Linux. basename command is basename - strip directory and suffix from filenames basename NAME [SUFFIX] basename OPTION… NAME…

basename Syntax

       basename NAME [SUFFIX]
       basename OPTION... NAME...

basename Examples

basename Command Manual / Help

We can use man and info command to see the manual page of basename command.

basename command also have --help option to show list of options.

To open man page for basename command we can use command below. To exit man or info page you can press q.

man basename

To open info page for basename command we can use command below.

info basename

To open help page from basename command we can run command below.

basename --help

Linux basename Command Source Code

You can find basename command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use basename in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.