2012-05-01 3 views
2

모습 단계 : bash : 마지막으로 방문한 경로에 버퍼가 있습니까? 이것

:~$ cd programacion/ 
:~/programacion$ cd sports/ 
:~/programacion/sports$ cd src/ 
:~/programacion/sports/src$ cd Sports/ 
:~/programacion/sports/src/Sports$ cd PlatformBundle/ 
:~/programacion/sports/src/Sports/PlatformBundle$ cd Entity/ 
:~/programacion/sports/src/Sports/PlatformBundle/Entity$ cd/
:/$ 

마지막 프롬프트에서이 순간에있는, 그것이 마지막 경로 내가 방문하기 때문에 programacion/sports/src/Sports/PlatformBundle/Entity에 직접 갈 수있는 방법이있다?

답변

5

당신은 마지막 디렉토리에 다음 바로 가기를 사용할 수 있습니다

cd -

예를 들어 :

[email protected]:~$ pwd 
/home/kbrandt 
[email protected]:~$ cd src 
[email protected]:~/src$ cd - 
/home/kbrandt 
[email protected]:~$ cd - 
/home/kbrandt/src 
[email protected]:~/src$ 

또 다른 옵션은 $OLDPWD 쉘 변수를 사용하는 것입니다.

+1

마지막으로 방문한 디렉토리는 환경 변수 'OLDPWD'에도 저장됩니다. –

3

배쉬의 pushdpopd은 원하는대로 할 수 있습니다.

$ help pushd 

$ help popd 
2

또한 있지만, 디렉토리, 역사를 비난하는 유사 Teleport 스크립트를 다운로드 할 수 있습니다.

관련 문제