You are not logged in.
I'm looking for a way to print the current directory, but just the current directory.
[username@hostname Screenshots]$ pwd
/home/username/Pictures/Screenshots
I want to figure out how to just print the name of the current directory, without all of the parent directories attached to it.
I've toyed around with grep, ls, and pwd, but I can't quite figure it out.
I've poured over man pages and other forums and haven't found anything. I'm really not sure if it's even possible.
But if it is, any help or input would appreciated.
Last edited by Tx86 (2022-12-14 15:20:16)
Offline
`basename $PWD`
Offline
Thank you, it does exactly what I want.
Offline