$ s=/the/path/foo.txt $ echo ${s##*/} foo.txt $ s=${s##*/} $ echo ${s%.txt} foo $ echo ${s%.*} foo
Reference: https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/