It's amazing how many years I've been using bash and I still have things to discover. Ctrl-x Ctrl-e nice tip!
Unix Tricks
21–30 of 166 posts
Re: Unix Tricks
#22You might want to try out the more modern fish shell as well: http://fishshell.com/ It makes history searching even easier.
I love fish and have happily been using it for years. Every time it comes up here, though, someone inevitably will complain about compatibility - and I will admit that RVM, for instance, has definitely caused me problems with fish in the past. I guess it depends quite a lot on your particular usage and requirements.
Re: Unix Tricks
#23alias clip='xsel -i --clipboard'
Get tree view of directories
alias lst='tree -L 2 $1'
Also I use za to go up in directory tree
bash https://gist.github.com/chanux/1119556 fish https://gist.github.com/chanux/9411092
Re: Unix Tricks
#24Ctrl-R is by far the most useful one for me.
Ctrl-P autocompletes from your history too. It works like Ctrl-R but after you've already started typing, if you see what I mean. This might be a zsh thing though.
Also, other emacs keys work like back: ctrl-b, meta-b, forward: ctrl-f, meta-f, start of line: ctrl-a, end of line: ctrl-e etc.
Re: Unix Tricks
#25Ctrl-R is by far the most useful one for me.
The article doesn't say, so it's worth mentioning that you can type ctrl-R multiple times to search further back into command history.
Re: Unix Tricks
#26Re: Unix Tricks
#27You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.
Here you go, just throw it in your .bashrc: shopt -s histappend export HISTSIZE=100000 export HISTFILESIZE=100000 export HISTCONTROL=ignoredups:erasedups export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND" I wish I could give credit to where I originally found this but it was ages ago.
Re: Unix Tricks
#28You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.
> You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly.
Yeah, keeping ctrl pressed in and pressing x followed by e (CTRL + x e) will open up the current line in $EDITOR and when you edit and save, replaces the current line with what you entered in your editor. Really a killer feature.Re: Unix Tricks
#29 man hier
is pretty cool. It explains the root directory structure of the system.Re: Unix Tricks
#30Earlier quoted context omitted.
I love fish and have happily been using it for years. Every time it comes up here, though, someone inevitably will complain about compatibility - and I will admit that RVM, for instance, has definitely caused me problems with fish in the past. I guess it depends quite a lot on your particular usage and requirements.
I never got RVM working with fish; unsurprising, seeing as it’s 20k lines of bash. rbenv works well though (with one additional conf line), and chruby was working on support last time I checked.