File system
basename
Removes directory path from filenames.
Ubuntu
CentOS
Debian
Arch
SUSE
Slackware
Alpine
Fedora
Verified: 2025-09-09
Syntax
$basename NAME [SUFFIX]
Examples
$basename /path/to/file.txt
$basename /path/to/file.txt .txt
Typical use cases
?
Standard usage
basename --help
Note
The opposite of dirname
Export