Bash: get current working directory name, but not full path
Yes, there is. You can use pure bash:
echo "${PWD##*/}"
or better, to avoid the case when you could be in -e
directory:
printf '%s\n' "${PWD##*/}"
(thanks to @gniourf_gniourf for the second suggestion).
Or you can use basename
tool:
basename "$PWD"