🧀 Learn Linux

Advanced · Organize files

dirname: Get the parent directory path

Put in free practice

Syntax

dirname path

Examples

dirname /var/log/app.log

Usage and sandbox support

The path does not need to actually exist.

Hands-on exercises

Full documentation ↗

Related commands