Don't waste your time by cd-ing in the terminal
31–40 of 124 posts
Re: Don't waste your time by cd-ing in the terminal
#32Re: Don't waste your time by cd-ing in the terminal
#33This is my blog.
FWIW, I've actually switched away from using the script mentioned in the link posted by OP and have moved towards using an improved version below.
http://www.huyng.com/bashmarks-directory-bookmarks-for-the-s...
This new version has 3 commands:
- "s" for save current directory as a bookmark
- "g" for jump to bookmark's directory
- "l" for list all bookmarks.Re: Don't waste your time by cd-ing in the terminal
#341. Go to the directory in question
2. Type "save nm" where "nm" is any short name for the directory, like "blog" or "blg"
3. From now on, type "cd nm" whenever you want to go there.
No session restart required, even.
I copied the code that enables this workflow from http://dotfiles.org/~jacqui/.bashrc (or was it https://gist.github.com/117528)
The idea is discussed here: http://hints.macworld.com/article.php?story=2002071600512379...
Re: Don't waste your time by cd-ing in the terminal
#35Don't waste your time bookmarking directories, jump right to them ;) https://github.com/rupa/z `z` tracks your most used directories. After a short learning phase, it will take you to the directory, based on its usage frequency and a hint you give it on the command line. Say I am often cd'ing into /var/www - then after a while I can just type `z ww`.
Re: Don't waste your time by cd-ing in the terminal
#36Another built-in worth knowing about is CDPATH.[1] I find that setting a sane CDPATH and bash-completion makes cd-ing anywhere I go regularly pretty trivial - just a few letters and a few TABs and I'm good to go. [1] http://caliban.org/bash/#bashtips
Having "cd foo" potentially take you to an entirely different location can be dangerous, to say the least.
Re: Don't waste your time by cd-ing in the terminal
#37 c(){ cd "$@" && ls;}
This has probably saved me days over the years, as I almost always want to list a directory after I change into.Re: Don't waste your time by cd-ing in the terminal
#38Don't waste your time bookmarking directories, jump right to them ;) https://github.com/rupa/z `z` tracks your most used directories. After a short learning phase, it will take you to the directory, based on its usage frequency and a hint you give it on the command line. Say I am often cd'ing into /var/www - then after a while I can just type `z ww`.
I remember seeing this, but forgot entirely to use it. Have been spending a while looking for it again, or something equivalent. Thanks.
Re: Don't waste your time by cd-ing in the terminal
#39Another built-in worth knowing about is CDPATH.[1] I find that setting a sane CDPATH and bash-completion makes cd-ing anywhere I go regularly pretty trivial - just a few letters and a few TABs and I'm good to go. [1] http://caliban.org/bash/#bashtips
I'd be extremely careful with CDPATH, never use this on an important host. Having "cd foo" potentially take you to an entirely different location can be dangerous, to say the least.
Re: Don't waste your time by cd-ing in the terminal
#40Instead of trying to remember where all your libraries are located, it will just open them up for you. Great for trying to debug misbehaving code.