Sample Header Ad - 728x90

cd 3 times to great-grandparent dir

0 votes
3 answers
1708 views
I have this: cd $(dirname $(dirname $(dirname "$0"))) && which will cd to project root. Is there shorthand for this somehow, where I can just be like: cd 3 && # not quite, but you get the idea or whatever, I mean why not you know? Maybe a command like so would be ideal: cdx 3 && since cd has no idea that 3 is not a file or directory.
Asked by Alexander Mills (10744 rep)
Jul 17, 2017, 07:23 PM
Last activity: Jul 19, 2017, 05:49 AM