in general we use
cd .. for going to the parent directory
cd ../../ to go to the parents parent directory. and
cd ../../../../../ for 5th parent directory.
is there any simplified way of doing this?
shell i am using is ksh.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This function is for Bash, but something similar could be done for others (this may work as-is in ksh and zsh):
Example usage:
Here’s a function that will
cdto a named subdirectory above the current working directory:Example usage: