Re: cd as "alias"
Paul Gear <paul@gear.dyndns.org> writes:
> Josef Oswald wrote:
>> Well while searching something else, I saw once a very neat alias for
>> cd.
>>
>> with this alias one was/is able to change into another directory without
>> first typing _cd.._ and then _cd_new_directory.
>>
>> so far I can remember the alias was like this
>>
>> alias cd ="cd .. && " but not much further.
>>
>> Anyone using something like this?
>
> The preferred method for this behaviour would be to run:
> export CDPATH=".:.."
>
> Example:
>
> enoch:/root # ls
> Old bin var
> enoch:/root # cd bin
> enoch:/root/bin # cd var
> -bash: cd: var: No such file or directory
> enoch:/root/bin # CDPATH=.:..
> enoch:/root/bin # cd var
> /root/var
> enoch:/root/var #
>
> --
> Paul
Thanks Paul :-)
This works ( of course otherwise you would not have posted here) :-)
> <http://paulgear.webhop.net>
--
LinuxUser aka Josef Oswald linux.os@chello.at
--
registered-linux-user # 134.818 at http://counter.li.org
The box said Windows, NT or better, so I installed Linux :-)
Reply to: