Here is a Linux command I never knew existing. basename returns a file/folder name without any of the leading directory information. If specified it even removes any trailing extensions. I have written entire bash subroutines to do exactly this; without the consistency of basename.