The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
6 basic cd tricks you should know and use!

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Jan Lelis

Posts: 136
Nickname: rbjl
Registered: Aug, 2009

Jan Lelis is an IT student from Dresden/Germany
6 basic cd tricks you should know and use! Posted: Oct 2, 2012 11:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jan Lelis.
Original Post: 6 basic cd tricks you should know and use!
Feed Title: rbJ*_*L.net
Feed URL: http://feeds.feedburner.com/rbJL
Feed Description: Hi, I am a fan of Ruby and like to explore it and the world around ;). So I started this blog, where I am publishing code snippets, tutorials for beginners as well as general thoughts about Ruby, the web or programming in general.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jan Lelis
Latest Posts From rbJ*_*L.net

And you’ll never want to miss them again!

1) cd without arguments

cd # brings you to your home dir, no need to do `cd ~`

2) cd -

cd - # goes back to the previous directory

3) cd ~username

cd ~git # goes to the homedir of the user "git"

4) $CDPATH

You can set a path in this variable in your .bashrc / .zshrc just like you do it with $PATH (separate multiple dirs with :). You can then cd into these paths from everywhere! Even the auto-completion works properly.

5) Dot Aliases

Put these into your .bashrc / .zshrc to quickly navigate through parent directories:

alias .='cd .'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'

6) cdargs

cdargs is a little collection of tools to quickly go to your favorite dirs. On ubuntu, you can install it using:

sudo apt-get install cdargs

Then add the following to your .bashrc / .zshrc:

source /usr/share/doc/cdargs/examples/cdargs-bash.sh

After that (and opening a new terminal), you can bookmark your current dir by typing:

ca some_name

You can jump to your bookmarked dir from everywhere by using:

cv some_name

cv without an argument returns a list of all bookmarks… It’s really easy, isn’t it ;)?

CC-BY (DE)

Read: 6 basic cd tricks you should know and use!


Topic: clojure: lein tar Previous Topic   Next Topic Topic: Clojure: Avoiding Anonymous Functions

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use