Software >> OS >> Unix >> Shell >> How to obtain the filename part of a full path

basename $filepath

e.g. if filepath=/var/cron/log

cat `basename $filepath` will give

log