Name
basename — stdin stdout
- file -- opt --help
--version
Synopsis
basename path
[suffix
]
The basename
command prints
the final component in a file path:
$ basename /users/smith/finances/money.txt
money.txt
If you provide an optional suffix, it gets stripped from the
result:
$ basename /users/smith/finances/money.txt .txt
money