Problem statement: I want to extract an unknown string(last string) from a given path name in a single line command.
- The path is dynamic and can change with users input.
- Only last string is to be extracted using only one line o command.
In this case, I need to just extract the word
In this again, I need to extact the last string
Is there a way to do this?
I tried to use
cut command but it didn't work as the path length is dynamic.