Zsh-lovers – tips, tricks and examples for the Z shell
grml.org
grml.org
The reason why I want such a list is I usually point people to zsh-lovers list who ask me why I use zsh, but something more to the point would be great, and probably more convincing.
$ tar --c<tab>
--check-device -- check device numbers when creating incremental
--check-links -- print a message if not all links are dumped
--checkpoint -- display progress messages every NUMBERth record
--checkpoint-action -- execute ACTION on each checkpoint
--compare -- find differences between archive and file system
--compress -- filter the archive through compress
--concatenate --catenate -- append tar files to an archive
--confirmation -- ask for confirmation for every action
--create -- create a new archive sudo aptitude install bash-completion #or apt-get install...
#Then in your .bashrc do something like:
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc).
if [ -f /etc/bash_completion ]
then
. /etc/bash_completion
fi
The latter (or equivalent) is already in /etc/skel/.bashrc on Debian at least (provided by the bash package), so users created with eg. adduser already have this in their .bashrc. IIRC it may be commented out in Debian stable - I currently run testing, and /etc/skel/.bashrc there contains: # enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
edit: missing wordsSometimes I wish there wasn't so much duplication of effort in this world..
Another thing I suggest doing is joining #zsh on freenode, and asking your questions there.
Yet another thing you could do is skim through the zsh user's guide[2], which is also kind of old, but is pretty comprehensive (for the time), and will give you more of a feel for what zsh can do. zsh's man pages are also very comprehensive (and huge), and might be worth a peek.
source virtualenvwrapper
and be done with it. I guess that's a (small) hit against zsh though. :P[1] /etc/bash_completion.d/virtualenvwrapper
It can, if you set the `globstar` option:
$ shopt -s globstar
$ echo **/*.txt
a/a2/baz.txt a/bar.txt a/foo.txt b/bar.txt b/foo.txt $ setopt brace_ccl #put this in your ~/.zshrc
$ echo {1-3}.pdf {a-d}.pdf
1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf $ echo {1..3}.pdf {a..d}.pdf
1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf <7-10>.txt
to match 7.txt, 8.txt, 9.txt and 10.txt. Zero-padding is loose. 07.txt and 08.txt match also, for instance. The bash {..} syntax just doesn't handle this variable 0-padding case, which is extremely common when looking at a directory full of photos, for instance.There are plenty more features like for example hashed directories, e.g. shortcuts to a directory:
hash -d log=/var/log
cd ~log # PWD is /var/log
and plenty more.The project is quite old already and could need some love. If someone wants to contribute, it's available on GitHub: https://github.com/grml/zsh-lovers
A more recent project similar to zsh-lovers is http://grml.org/zsh-pony/ - this are the notes from a talk I gave at DebConf 2011 and also covers some nice features of Zsh. Should be easier to go through that than through zsh-lovers if you're interested in an introduction of nifty features.
I guess the reason why no up2date list of "what Zsh can do but Bash can't" exists is that most people who explore Zsh never really look back to Bash once they went the Zsh route. Bash v4 got some features from Zsh but there are so many small things that Zsh still provides that once you get used to them you never want to go back. :)
That's not much of an alias. Usually I use them to shorten the typing, not make it longer.
Here's my suggestion:
alias "list all files, but don't show much info"= ls
Premature 4/1