This should do the trick
pwd | tr "https://stackoverflow.com/" '\n'
If you don’t want an empty line in the beginning (due to the initial /
) you could do
pwd | cut -b2- | tr "https://stackoverflow.com/" '\n'
Example:
#aioobe@r60:~/tmp/files$ pwd
/home/aioobe/tmp/files
#aioobe@r60:~/tmp/files$ pwd | cut -b2- | tr "https://stackoverflow.com/" '\n'
home
aioobe
tmp
files