The cd command can do this?
How can I get back to the previous directory with cd? For example
$pwd /home/zhou/fdk/fkd/ai/bbs/linux/fl/bt/mm/xx $cd $pwd /home/zhou Now I want to get back to the xx directory,how can i do that with cd? Obviously I don't want to type such long directory path. |
use the command "cd -"
|
No need to type it, use tab completion. So you would do
Code:
cd /home/zhou/f<hit tab>/f<hit tab> .... and so on |
Many thanks
|
I think cd - is quicker than tab when getting back to previous directory
|
You can also use pushd and popd, e.g.:
Code:
slackme:~/prog/lanalytics 20$ pwd |
You can do more magic with the CDPATH environment variable. Look here for example.
|
All times are GMT -5. The time now is 06:21 PM. |