Switch back to the last working directory (Linux)

Configurare noua (How To)

Situatie

Assuming you navigate to different directories for certain activities, but suddenly you would like to go back to the last (long) working directory.

Solutie

For this you can use the following command :

Syntax:

cd -

Output sample:

--- snip ---

[root@linux_host ~]# cd /mnt/stage/Testing/sciobote/BACKUP/18gi_cluster_oraarch
[root@linux_host 18gi_cluster_oraarch]# cd /tmp
[root@linux_host tmp]# pwd
/tmp
[root@linux_host tmp]# cd -
/mnt/stage/Testing/sciobote/BACKUP/18gi_cluster_oraarch
[root@linux_host 18gi_cluster_oraarch]# pwd
/mnt/stage/Testing/sciobote/BACKUP/18gi_cluster_oraarch
[root@linux_host 18gi_cluster_oraarch]#

--- snip ---

Tip solutie

Permanent

Voteaza

(23 din 56 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?