Here's a list with some (by far not all of course) Bash tutorials found on the Internet.
The primary purpose of that list is to lead beginners to good tutorials and not to the wrong ones. However, the secondary purpose is to provide information to increase quality of the linked tutorials.
My expirience shows that nobody is interested when you "just send a mail to the author", even if he links a big "contact me" in his article(s). This is another try of influencing the Bash world.
Note that these recommendations are my personal opinion. Please contact me
The recommendation-indicator "REC" used below is a number between 1 and 10 visualized as a bar:
Not recommended to read, at best, don't click the link.
Use it with care!
The perfect godlike tutorial (I doubt I'll ever find it)| Name (Links to review below) | Weblink | REC indicator | Comments |
|---|---|---|---|
| Bash guide on Greg's wiki | click | ![]() | This guide teaches modern stuff and good practises. I recommend to learn from it. It was written by the guys in #bash IRC channel on Freenode (mainly lhunath), because there are so many bad tutorials out there. |
| Steve Parker's shell scripting guide | click | ![]() | Very good (not only Bash) shell scripting guide. Teaches good practices, gives background information. |
| Bash Guide for Beginners (review) | click | ![]() | Good introduction that really requires no previous knowledge, also covers the most important unix utilities |
| Advanced Bash Scripting Guide (ABS) (review) | click | ![]() | Though the ABS doesn't teach the really advanced and safe stuff everywhere, it's one of the most complete and best tutorials I know. You will get a very good start when you learn from it. |
| IBM developerWorks "Bash by example" | click(1) click(2) click(3) | ![]() | Doesn't teach outdated stuff, doesn't tell you wrong things. A good start, though not that detailed. |
| Deadman's | click(1) click(2) | ![]() | Focus isn't scripting per se. Focus is interactive use and increasing the productivity on the prompt. Teaches some nice features. |
| Bash Shell Programming in Linux (P. Lutus) | click | ![]() | Good start. Though there are small bugs. |
| BASH Help at hypexr.org (review) | click | ![]() | Shows you some nice stuff and links to other ressources. Not a tutorial to learn Bash, though. |
| Bash Programming Introduction HowTo (TLDP) (review) | click | ![]() | A bit outdated, but usable as a start to get into the Bash world. |
| Quick guide (review) | click | ![]() | Usable as a start. Doesn't teach wrong stuff, shows you good practices. |
| Linux Shell Scripting Tutorial v2.0 (review) | click | ![]() | currently reviewing (the tutorial is also under development) |
| linuxconfig.org Bash Scripting Tutorial (review) | click | ![]() | Teaches many outdated, unstable, undetailed stuff. You won't learn scripting from there. |
| LinuxCommand.org: Writing shell scripts. (review) incomplete, thus no ranking | click | ![]() | Practise oriented, some mistakes/flaws, but sadly it stops in the middle |
Article link: http://www.linuxconfig.org/Bash_scripting_Tutorial
Discussion link: http://www.linuxconfig.org/Talk:Bash_scripting_Tutorial UPDATE: Discussion page is gone.
Though the basic idea is nice, using flash terminal sessions and screenshots, there are many bugs or bad constructs.
Some stuff I didn't like there:
which instead of builtin type -p to determinate the location of a programfunction SOMENAME keyword instead of the common POSIX-compatible variant SOMENAME() to define a function$( ... ) for command substitution$@ already is array-likeif/else stuff looks as if the test (or [ ...]) command is the only thing Bash can execute and checkfor loop example that will explode on word-splittingtest, not modern arithmetic componentsgrep -r hda6 * . 1>&2 stderr.txt
twkm commented some things on their http://www.linuxconfig.org/Talk:Bash_scripting_Tutorial, I liked this article there. UPDATE: Discussion page is gone.
Overall, if the author doesn't change the article, it's unusable from my point of view. At least unusable to teach sane Bash scripting.
Article link: http://www.panix.com/~elflord/unix/bash-tute.html
Discussion Link: not available
This article is usable as basic introduction into the Bash world. It doesn't teach you wrong things, and it uses correct syntax and explanations nearly everywhere. However, it's not usable as complete learning tutorial - but that is not the goal.
One point (I have to critizize something
):
2.05b) Bash version)
Article link: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Discussion link: not available; EMail: mikkey (AT) dynamo.com.ar
A few points:
if [expression];", which is wrong)seq(1)I like the style this article is written in. If some points are fixed, it could be a really usable starting point for newbies.
Article link: http://www.hypexr.org/bash_tutorial.php
Discussion link: not available; EMail: scott (AT) hypexr.org
The article is usable to step into the shell world. It's not a tutorial per se, it will tell you some nice CLI-specific things like readline or completion.
Only one point:
Article link: http://tldp.org/LDP/abs/html/
Discussion link: not available; EMail: thegrendel (AT) theriver.com
The only big problem I see with the ABS is, that the name doesn't match the reality. It doesn't teach advanced techniques. That doesn't mean the guide isn't good! It's one of the biggest, most complete and interesting Bash guides I've seen.
I don't want to write every point here that disturbs me. In general it's not that important since the mistakes or wrong assumptions it makes are minimal. Also I noticed that mistakes in example scripts vanish over the time, the author polishes his work. Thanks Mr. Cooper.
The ABS is definitely worth to read to step deeper into the Bash and commandline world of Linux (since many Linux-specific examples are there, they're unusable for Unices).
Article link: http://tldp.org/LDP/Bash-Beginners-Guide/html/
Discussion link: not available
Good introduction to bash and shell scripting, the guide is fairly complete and requires almost no previous knowledge other than be able to type some commands in a shell.
Some advices are a bit strange or outdated "Real Programmers - Most programmers will prefer to use the test built-in command" "Wherever possible, Bash users should try to use the syntax with angular brackets:($[ ])" but all in all a nice tutorial to get a good overview of shell programming starting from 0.
Article link: http://bash.cyberciti.biz/guide/Main_Page
Discussion link: use the individual MediaWiki discussion pages
Additional problem: The author rates his shell skills as "9 of 10" in his CV. After reading this tutorial personally I'd rate him 3/10
This guide got some big problems. It seems to cover a lot of material but has some pretty nasty issues, too. Examples:
$var and echo ${var} mostly without quoting.Conclusion
Beside all the bashing (sorry!) above: I think the problem is the following, the author did alot using the shell, and he knows much things. Admitted. But he doesn't know and/or understand the underlying concepts of most of the stuff. This - in my personal opinion - disqualifies him as the author of a guide/tutorial for shell scripting.
But
The tutorial is under development. It improves here and there. But the code style and robustness problems still remain.
Article link: http://linuxcommand.org/writing_shell_scripts.php
Discussion link: not available
Bad:
.bash_profile and .bashrc is wrong ("Though placing your aliases and shell functions in your .bash_profile will work, it is not considered good form.")which command, which might be popular here and there, but should not be used for various reasonsUPPERCASE names are constants, this might be a good style, but it's not a programming feature. Real "constants" are made up from read-only variablesecho command that interprets them! On the other hand, it misses the quoting style that makes the shell interpreting ANSI C escape sequences.function keyword to define a function, which is correct, but bad style and unportablegetopts for positional parameters, at least as an "advanced example"$@) unquoted, and thus unsafe or buggySIGKILL can't be trapped, also the process stop signal. But that shouldn't really matter for daily shell codingmktemp or thelikeGood:
test command in a nice and understandable wayexpr or let for arithmetics, good
Discussion