Back to the learning path

dirname

dirname: the directory name Command details
Step 1/1: The directory of a path

dirname PATH drops the last part and keeps the directory, the opposite of basename.

$ dirname /var/log/nginx/access.log
Fundamentalsdirname
Which directory is it in?
Use dirname to print the directory part of /srv/www/music/list.log.