SyntaxFix
Write A Post
Hire A Developer
Questions
The following approach can be used to get any path of a pathname:
some_path=a/b/c echo $(basename $some_path) echo $(basename $(dirname $some_path)) echo $(basename $(dirname $(dirname $some_path)))
Output:
c b a