dirname - strip the last component from a filename
dirname path
Try dirname in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.