Bash get filename from given path on Linux or Unix

Originally published at:

How do I extract filename and extension in the Bash shell script from the given path? How can I get filename from the path under the bash shell?

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki