SyntaxFix
Write A Post
Hire A Developer
Questions
Just use basename:
basename
echo `basename "$filename"`
The quotes are needed in case $filename contains e.g. spaces.