basename: change description and add directory example (#4528)
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
# basename
|
# basename
|
||||||
|
|
||||||
> Returns non-directory portion of a pathname.
|
> Remove leading directory portions from a path.
|
||||||
|
|
||||||
- Show only the file name from a path:
|
- Show only the file name from a path:
|
||||||
|
|
||||||
`basename {{path/to/file}}`
|
`basename {{path/to/file}}`
|
||||||
|
|
||||||
|
- Show only the rightmost directory name from a path:
|
||||||
|
|
||||||
|
`basename {{path/to/directory/}}`
|
||||||
|
|
||||||
- Show only the file name from a path, with a suffix removed:
|
- Show only the file name from a path, with a suffix removed:
|
||||||
|
|
||||||
`basename {{path/to/file}} {{suffix}}`
|
`basename {{path/to/file}} {{suffix}}`
|
||||||
|
Reference in New Issue
Block a user