I've been using this for a few years and it's been a joy.
Don't waste your time by cd-ing in the terminal
101–110 of 124 posts
Re: Don't waste your time by cd-ing in the terminal
#102Re: Don't waste your time by cd-ing in the terminal
#103I've also wondered to myself why there isn't a terminal program with a directory tree by the side so you could just click on the directory that you want to be in, instead of ls -cd-tab-blah-^H-tab-^M. It would also a have a list of favorite and most-recently-used directories. A weekend project, perhaps...
Krusader also has a built in console pane.
Not strictly a terminal as the console is running over KDE over X, ..., but works for me.
Re: Don't waste your time by cd-ing in the terminal
#104I like this workflow better: 1. 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.mac…
Or in zsh: setopt cdablevars nm=/path/to/whatever cd nm
touch ~/.zshmarks && source ~/.zshmarks
function b() {
echo "hash -d $1=\"`pwd`\"" >> ~/.zshmarks && source ~/.zshmarks
}Re: Don't waste your time by cd-ing in the terminal
#105Earlier quoted context omitted.
Or in zsh: setopt cdablevars nm=/path/to/whatever cd nm
you can put this in ~/.zshrc for persistent zsh bookmarks touch ~/.zshmarks && source ~/.zshmarks function b() { echo "hash -d $1=\"`pwd`\"" >> ~/.zshmarks && source ~/.zshmarks }
Re: Don't waste your time by cd-ing in the terminal
#106Earlier quoted context omitted.
Why not just: echo "export nm=`pwd`/blog"' >> ~/.profile . ~/.profile cd $nm There's no need for magic when you know how to shell.
Why not just shopt -s cdable_vars nm=`pwd`/blog cd nm No need for hacks when you know how to shell.
$ cd /
$ nm=/foo
$ ls | grep nm
$ cd nm
$ pwd
/foo
$ cd ~
$ ls | grep nm
nm
$ cd nm
$ pwd
~/nm
$ echo FFFFFUUUUUUUUU
Inflexible: $ cd nm/jan/img
cd: No such director nm/jan/img
$ echo SHIT
SHIT
$ cd $nm/jan/img
Worse, It's nonstandard and only saves you one chracter.Re: Don't waste your time by cd-ing in the terminal
#107Why is a home-rolled cd script interesting when there are many more mature, feature-rich cd-tools out there? * http://www.skamphausen.de/cgi-bin/ska/CDargs * http://micans.org/apparix/ * http://github.com/joelthelion/autojump * http://github.com/rupa/z * http://github.com/flavio/jump Also, the title is misleading. I thought it was actually a commandline tool that removed the need to cd most of the time, like lightnin…
Re: Don't waste your time by cd-ing in the terminal
#108Re: Don't waste your time by cd-ing in the terminal
#109Don'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
#110There's also the pushd and popd commands which are part of bash already. And there's a wikipedia entry for this even: http://en.wikipedia.org/wiki/Pushd_and_popd
You can also use the "dirs" command (I think part of bash as well) that tells you the state of the stack. If you set the -v option, you can get the depth of different directories, and you can just do pushd +N to jump to the specific directory.