basename - Unix, Linux Command


Advertisements


NAME

basename - Strips directory and suffix from filenames.

SYNOPSIS

basename NAME [SUFFIX]
basename OPTION

DESCRIPTION

basename prints NAME with any leading directory components removed. If Suffix is specified, it will also remove a trailing SUFFIX.

OPTIONS

TagDescription
--helpDisplay help
--versionOutput version information and exit

EXAMPLES

To get the name of the file present in test folder

$ basename test/sample.txt
sample.txt


Advertisements