- Published on
Short engineering note
Today I Learnt: Extract dirname from a path
- Authors

- Name
- Mehdi Akiki
Note · Engineering notes
Get directory name:
dirname /path/to/file.txt # -> /path/to
Tip: combine with basename to split a path.
Short engineering note
Note · Engineering notes
Get directory name:
dirname /path/to/file.txt # -> /path/to
Tip: combine with basename to split a path.