From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7449 invoked by alias); 4 Dec 2013 07:18:11 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18194 Received: (qmail 18297 invoked from network); 4 Dec 2013 07:18:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Date: Wed, 4 Dec 2013 08:06:32 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: directory alias Message-ID: <20131204070632.GA3114@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: zsh-users@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13120407-1948-0000-0000-0000071B2EE0 On Tue, Dec 03, 2013 at 10:21:53PM -0500, shawn wilson wrote: > What I want is a way to do: > cd foo > and it go to ~/some/deep/directory/tree/foo > and > cd bar > and it go to /usr/local/some/path/bar > > Is there some zsh-ism (or better bash-ism that also works in zsh so > that this works on systems I maintain without zsh) to do this without > symlinks? Named directories. $ hash -d foo=~/some/deep/directory/tree/foo $ hash -d bar=/usr/local/some/path/bar cd ~foo cd ~bar Personally I prefer aliases like alias cfoo "cd ~/some/deep/directory/tree/foo" as I don't like to have the shortcuts for manually named dirs in the prompt. And actually finding these cd commands from the history works automatically without having to define aliases or hash table entries manually. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany