kdb basename <key name>
Where key name
is the name of the key.
This command is used to retrieve the basename of a key.
This command will return the following values as an exit status:
- 0: No errors.
- 7: invalid key name passed, see kdb(1) for a list of return codes used by kdb.
-n
,--no-newline
: Suppress the newline at the end of the output.
kdb basename user:/key/subkey
#> subkey
kdb basename user:/key/subkey/
#> subkey
kdb basename /
#>
- See kdb-namespace(1) and kdb-dirname(1) for other namepart extraction operations.
- The Unix analogue [BASENAME(1)].
- To get keys in shell scripts, you can use kdb-sget(1).
- elektra-key-names(7) for an explanation of key names.