Imagine you have a toy box and inside it there are many toys that you love. Each toy is in its own little compartment or section of the toy box. Now imagine that the toy box is your computer and the toys inside are different files and folders.
The toy box has a label on it that says "root". This is the starting point or the top of the toy box. Now, let's say you want to find the location of a specific toy, or file, called "teddybear". You need to follow the compartments or sections of the toy box until you get to the one that has the teddybear inside.
The dirname command is like an instruction that tells your computer to take the full path or address of a file or folder, and only show you the path leading up to the last folder or directory. It's like looking at a map and only seeing the street that the toy shop is on instead of the entire map of the city.
For example, if you have a file located in the folder "/home/user/desktop/documents" and you use the dirname command on it, it will only show you "/home/user/desktop" and not the entire path including "documents".
In simpler terms, the dirname command shows you the parent directory or the folder that contains the file you're looking for. It's like asking your parent where your favorite toy is and they tell you which room it's in, but not the exact location in that room.