basename

Strip directory from a path

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Prints the final component of a path and optionally strips a suffix.

Examples
basename /var/log/syslogprints syslog · explain & risk-check →
basename archive.tar.gz .tar.gzprints archive · explain & risk-check →
Related
dirname realpath
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man basename for your version. Test destructive commands on a non-production system first.