The single best shell productivity tip for me was to use z: https://github.com/rupa/z It automatically makes a list of directories you frequently use in your shell and if you type `z a-small-substring-of-the-directory-path` it does a cd to that directory. (e.g. I type `z and` and it changes my current directory to $HOME/Work/Projects/android`). Saved me tons of typing.
Shell Productivity Tips and Tricks
31–40 of 97 posts
Re: Shell Productivity Tips and Tricks
#32Earlier quoted context omitted.
As zsh is mentioned at various points throughout the article I'll add that zargs¹ is often a great alternative to xargs. Combined with zsh's awesome globbing and filtering functionality it is often far nicer to work with than find. 1. https://github.com/zsh-users/zsh/blob/master/Functions/Misc/... or zshcontrib(1)
I think zsh is the best shell ever, unfortunately, I've reverted to bash, because it's too much hassle to install zsh everywhere I work. zsh globbing is on another level.
Re: Shell Productivity Tips and Tricks
#33The single best shell productivity tip for me was to use z: https://github.com/rupa/z It automatically makes a list of directories you frequently use in your shell and if you type `z a-small-substring-of-the-directory-path` it does a cd to that directory. (e.g. I type `z and` and it changes my current directory to $HOME/Work/Projects/android`). Saved me tons of typing.
A somewhat less fancy version of this is $CDPATH. export CDPATH="/path/to/my/projects:$HOME/Work/Projects" # From anywhere. cd andr
A huge block of "unalias" calls at the beginning of shell scripts used to be a common practice, but they don't seem to be found in more widely-used tools these days.
Re: Shell Productivity Tips and Tricks
#34That's quite not what ^X^X does. The bash man page says:
Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.
Re: Shell Productivity Tips and Tricks
#35The primary reason I chose over zsh/bash was that autocompletion just works. If you install it, I highly recommend oh-my-fish as well, which allows you to add packages for look/functionality: https://github.com/oh-my-fish/oh-my-fish
If you're a zsh user, they have a similar framework: oh-my-zsh: https://github.com/ohmyzsh/ohmyzsh
Re: Shell Productivity Tips and Tricks
#36It's incredibly easy (and transparent) to "install" and saves a ton of keystrokes.
Re: Shell Productivity Tips and Tricks
#37Ctrl-a ctrl-k to clear the current command, or redo a hidden password prompt if you know you fat-fingered it.
ctrl-a jumps the cursor to the beginning of the line, and ctrl-k deletes from current position to the end of the line.
The mnemonic to remember these: "a" is the first position in the alphabet, and jumps you to the first position. "K" is short for "kill.”
Re: Shell Productivity Tips and Tricks
#38> If you want to remove a sensitive command from your history, you can simply edit your $HISTFILE history file and remove it. It’s already too late at this point. Anybody on your machine can read the commands you are running, for example with ps. You should instinctively avoid entering anything in plaintext into a terminal which you don’t want other people to see. Any command line tool worth its salt will provide alt…
Re: Shell Productivity Tips and Tricks
#39The single best shell productivity tip for me was to use z: https://github.com/rupa/z It automatically makes a list of directories you frequently use in your shell and if you type `z a-small-substring-of-the-directory-path` it does a cd to that directory. (e.g. I type `z and` and it changes my current directory to $HOME/Work/Projects/android`). Saved me tons of typing.
A somewhat less fancy version of this is $CDPATH. export CDPATH="/path/to/my/projects:$HOME/Work/Projects" # From anywhere. cd andr
yum install -y bash-completion
bash # a fresh runRe: Shell Productivity Tips and Tricks
#40On more handy set of emacs-derived keystrokes: Ctrl-a ctrl-k to clear the current command, or redo a hidden password prompt if you know you fat-fingered it. ctrl-a jumps the cursor to the beginning of the line, and ctrl-k deletes from current position to the end of the line. The mnemonic to remember these: "a" is the first position in the alphabet, and jumps you to the first position. "K" is short for "kill.”