Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コマンドでディレクトリを変更するとcd、以前の作業ディレクトリを覚えていない限り、失われます。すぐに戻る便利な方法はありますか?
cd
デモ:
$ cd ~/some_path $ cd /another_path $ command_to_go_back_to_some_path
最後のディレクトリに戻ることができますcd -
cd -
これを行うこともできます
$ pushd ~/some_path $ pushd /another_path $ popd $ popd
前述のように、使用できますcd -。シェルは内部的にcd $OLDPWD.
cd $OLDPWD