I need to print the path of the current, parent and root directory in UNIX. I can use commands, or a shell script. I managed to do that for the current and the parent directory, but I do not know how to print it for the root directory.
Here is what i have done:
- current:
pwd
- parent:
echo $(pwd) | sed -e s/\\/[^\\/]*$//