dirname

Strip last component from a path

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Prints the directory portion of a path (everything before the last slash); handy in scripts to locate sibling files.

Examples
dirname /var/log/syslogprints /var/log · explain & risk-check →
Related
basename realpath
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man dirname for your version. Test destructive commands on a non-production system first.