Yes... 'cd -' works previous channel button on a tv remote. 'pushd/popd' put
the directories on a stack. So we can change many directories in the middle
and just come back to original directory in the end.

e.g.

#pwd
/first/dir/
#cd /second/dir
#cd /third/dir
#cd -
#pwd
/second/dir
#cd -
#pwd
/third/dir

whereas,

#pwd
/first/dir/
#pushd /second/dir
#cd /third/dir
#popd
#pwd
/first/dir

______Sudarsan


On Thu, Oct 8, 2009 at 11:37, narendra sisodiya <[email protected]
> wrote:

>
>
> On Thu, Oct 8, 2009 at 11:20 AM, Sudarsan Sridhar 
> <[email protected]>wrote:
>
>> For those who use terminal a lot: Sometimes there is a requirement to save
>> the previous working directory and change to another directory, do something
>> and come back. The commands 'pushd' and 'popd' help.
>>
>> e.g,
>>
>> #pwd
>> /original/directory
>> # pushd /path/to/the/new/directory
>>
>> ---do something---
>>
>> #popd
>> #pwd
>> /original/directory
>>
>>  If I am not wrong, we can jump to prev directory using "cd -"
> $cd -
> --
> ┌─────────────────────────┐
> │    Narendra Sisodiya ( नरेन्द्र सिसोदिया )
> │    Web : http://narendra.techfandu.org
> │    Twitter : http://tinyurl.com/dz7e4a
> └─────────────────────────┘
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Do you have another question? Click here - 
http://groups.google.com/group/iitdlug/post
Read archive - http://www.mail-archive.com/[email protected]/
l...@iitd community mailing list -- http://groups.google.com/group/iitdlug
-~----------~----~----~----~------~----~------~--~---

Reply via email to