basename will work, but if you have a deeper directory tree things could go wrong (depending on what you want to do). If the following is found: ./X/Y/somefile, basename will return somefile. It will also return somefile for the following: ./X/Y/Z/somefile.
But like I said, it all depends on what you want to do with the output.
Hope this clears things up.