備忘_linux_cd ../[directory name]
手順をみていると
cd ../[directory name]
というパターンがでてくる
cdの移動はあまりまとめてやらず、1階層で移動することが多い。
なので、上記のコマンドでてくると結局どう移動した??
というのが直感的にあたまに浮かばない
なので、手元で動作確認しておいた。
例
cd ../test
->階層を1個上に上がる(..)-->その後./testディレクトリへ移動
動作確認
#現在の位置。cdtestはmkdirであらかじめ用意しておいた
[root@centos cdtest]# pwd
/root/cdtest
[root@centos cdtest]# cat /etc/redhat-release
CentOS release 6.9 (Final)
#/root以下のcdtest2へ移動
[root@centos cdtest]# cd ../cdtest2
#現在の位置
[root@centos cdtest2]# pwd
/root/cdtest2
##-->移動できた。
いままでは
cd ..
cd cdtest2
と2コマンド打って移動を行っていた。