How to get the file name from absolute path in Unix?

Consider the absolute path as /tmp/Shell_Script/sample_scripts/script.sh

In order to retrieve the name "script.sh", use the below command

basename /tmp/Shell_Script/sample_scripts/script.sh

The above command will retrieve the file name alone.

Search