zsh, simply for the completion and expansion options. For example, if you double-tap [tab] on an ambiguous command, bash's behaviour is to print all possible options and then open a new prompt - whereas ZSH displays the options but keeps you on your same line. And you can expand wildcards - so if I have some file /this/is/my_very_long_and_full_directory/file.ext
, I can do /this/is/my*/*.ext
, and it will expand to every options matching those wildcards (very useful for checking). Other people have their own favourite features, but these are mine.
And of course, it's backwards compatible with bash, so you can't lose!
So to get things started, I'd like to mention grml. grml is a Debian based live-cd with a sysadmin / technical user focus. I use it quite a bit for for the included disk utilities, and have used it to recover damaged master boot records. It also introduced me to zsh, which I now use as my user shell.
Neat trick! As a zsh user, I googled to see how I can enable that function in zsh, and stumbled upon this mail. It's now part of my .zshrc. :-)
Also, what's up with that blog? I've seen it linked quite a lot recently, and the posts are really interesting too.
Edit: eh, just realised it's your blog. Good work on the material there, I really enjoy reading it.
zsh - especially its file matching abilities. For example:
grep wibble */.(js|html)
will search for "wibble" in .js and .html files in the entire directory tree from the current directory down. This is why I have not felt the need to switch to ack and almost never use find.
sed and awk.
ipython - not only for developing python code, but also for doing data processing tasks that are too complex to easily do in sed or awk.
I use head a lot when developing a complex pipeline as a quick check to see that it is doing what I expect without it running off and processing gigabytes of data.
seq to loop a fixed number of times in a shell script:
for x in seq 10
; do
echo $x
done
The combination of sort | uniq -c | sort -n is useful to get a count of how many of each unique string is in the input. For example to get the ten most frequent words in a file, along with their counts:
cat somefile.txt | tr -s '[:space:]' '\n' | sort | uniq -c | sort -nr | head -n 10
Did you use colours in your prompt? If you did then that's probably what caused it, afaik it's an issue with the prompt program 'bash', if you feel like trying new things you can try a different prompt called 'zsh' which doesn't have this problem, is more powerful and a bit easier to customise. It's almost completely compatible with bash so you shouldn't really notice any difference other than extra features.
# aptitude install zsh
;)
Edit:
Also the ArchLinux Wiki has a very informative section on zsh. They've also got one on making a colourful bash prompt, covering similar stuff to what annampride wrote in their article.
a very interesting hack I discovered today, credits go to Daniel Shahaf: http://www.zsh.org/mla/users//2017/msg00422.html
basically you can split up your zsh completions by category, as demonstrated in the screenshot. there, I just typed d_[tab]
> How can I fix this? I don't have root access to this system.
You can set configuration options for just your user account by editing ~/.zshrc
. That should override global configuration options.
And apparently you are not the only one annoyed by that. See: Cursor position in shell history.
Whilst <Tab><Tab> is indeed useful, it's actually your shell handling this rather than a command as such. Different shells do this differently, from the description you've given it sounds like you're using bash.
In the shell I use, zsh, you can configure this behaviour fairly extensively. I have it so <Tab><Tab> gives you a menu of the items that match that you can scroll through.
Edit: fixed zsh link.
The wait0
case is scheduled as follows:
ANFD="13371337" # for older Zsh + noclobber option exec {ANFD}< <(builtin print run;) command true # workaround a Zsh bug, see: http://www.zsh.org/mla/workers/2018/msg00966.html zle -F "$ANFD" -zplg-scheduler
So adding a sleep
before the print
would help, however I'm hesitating with such a change, as it will make the first plugin load later.
> $ v="(" > $ [ $v = ")" ] && echo t > t # wrong!
Looks like you found a bug in zsh. I'll report it to the zsh-workers list.
By the way, this really belongs in /r/zsh instead.
edit: A patch has already been made: http://www.zsh.org/mla/workers/2015/msg03276.html
My vote goes for zsh (Caveat - I haven't spent much time with BASH, so some of these features may also be available there). It has so many features that make my life easier (once set up properly of course):
Advanced tab completion all over the place (cd, ls, kill, parameters, options, arguments, etc)
Complete_in_word (not only at end of it)
Expand short paths (EG /h/m/d/w/t/p<TAB> expands to /home/me/docs/work/texts/physiology)
Mime-type handling (just type path to file and the "correct" program will open it)
Powerful key-bindings (great for changing a few annoying vi-like limitations)
Fast, powerful command history (love me some incremental search)
Shared history among zsh instances
Globbing (say goodbye to find, and xargs, mostly)
Command correction (argument correction also available)
cd old new (replaces "old" with "new" in current path)
Named directories (much like marks in vim, or aliases for dirs)
Auto_cd (cd without typing cd)
Auto_pushd (cd automatically pushes dirs onto dirstack)
Global aliases (EG alias -g DN='>/dev/null' so that 'cmd DN' redirects output to /dev/null)
I'm sure there is more. But these are what I tend to miss with other interactive shells (fish being the exception).
Your example works perfectly fine for me without single or double quotes (in both bash and zsh (with no .z* config files), also on arch). It looks like zsh may use carat expansion as a way of doing replacement. Perhaps it's also part of your setup, it's difficult to say (ex if you use oh-my-zsh, omz might introduce it).
http://www.zsh.org/mla/users/2002/msg00325.html
EDIT: bash (4.3.39(1)-release) zsh (5.0.8)
Speaking of comman line commands and history search, CTRL-R is another good one, to search recursively through the recently executed commands.
Even without zsh, there is plenty of shell commands which will help you to work more effective out of te command line. To understand the shell history and the regarding commands, there's a really good basic tutorial on youtube. A few months ago I've put some effort to collect all commands mentioned in the video and create a tex file out of it. Hope you guys will appreciate, feedback is welcome!
Straight to the answer:
Learn Code The Hard Way's CLI crash cource is the best source for this. It covers both the unix and windows terminals.
After you've completed the course, just mess around with the terminal. There are many terminal cheat sheets, but you can find use for it quite easily if you want to code with a text editor (like many people do successfully).
Extra info:
You are quite correct that nowadays it's a must to be able to use the terminal. Having good terminal knowledge sets you up for any kind of development. Surely and IDE will ease the job, but knowing what the IDE does beneath is much better and it's common to get asked about such 'geeky' stuff in interviews too.
P.S Over time you'll develop a terminal fetish, as many of us terminal users do. To spare you the time of looking into different sources. Very soon you may want to look into Zsh and Oh-my-Zsh
Oh, I doubt it's a problem on zsh's end. As I said, the Arch Linux packages have the man pages, and http://www.zsh.org/pub/zsh-${pkgver}.tar.bz2
has the man pages in it. Looking over the PKGBUILD
, it doesn't describe any flags related to the man pages, so the standard zsh build process must handle them correctly by default.
I'd suggest, as a result, that the issue isn't a matter of the zsh dev team doing something wrong, but the package maintainer doing something wrong.
just correcting your link, at least for my browser the whole adress has to be written out: zsh. I've heard of zsh once but didn't find the time to take a deeper look into it, will consider to give it a try though! From what i've read, seems to be a powerful tool! Thx!
Edit: Could you by chance let me have a look onto your zsh-config file? This <TAB><TAB> option you mentioned seems interesting to me.
i3 Tiling Window Manager, configure rxvt or xterm, setting up your bash PS1 & aliases, install ZSH, and set up vim or emacs for a programming enviroment.
Just a few suggestions.