# ansible.builtin.dirname
Returns the ‘head’ component of a path, basically everything that is not the ‘basename’.

## Examples
```yml
# To get the dir name of a file path, like '/etc/asdf' out of '/etc/asdf/foo.txt'.
{{ mypath | dirname }}
```