Linux Today: Linux News On Internet Time.

Linux basename Command Tutorial for Beginners (with Examples)

Jul 05, 2018, 10:00 (0 Talkback[s])
(Other stories by Himanshu Arora)

Sometimes, while working on the command line (especially when dealing with shell scripts), you might be interested in only the filename, but what's available to you is the complete path of the file. So, the requirement is to strip the directory component of the path. You'll be glad to know there exists a command - basename - that does this job.

Complete Story