pwd | rev | cut -d/ -f1 | rev
lets see arguments for cut used with above command
spliting delimeter is given to -d, in this case \
required argument is given to -f, in this case 1
rev is used to reverse the string because parent directory name is the first argumet from reverse of pwd.
No comments:
Post a Comment