Learning bash scripting for beginners

Bash (Bourne-Again SHell) is a Linux and Unix-like system shell or command language interpreter. It is a default shell on many operating systems including Linux and Apple MacOS X. Shell scripts are a fundamental part of the Unix programming environment. If you have always used a graphic user interface like KDE or Gnome or MS-Windows or Apple OS X, you are likely to find bash shell confusing. If you spend some time with the bash shell prompt and it will be difficult for you to go back.


Here are a list of tutorials and helpful resources to help you learn bash scripting and bash shell itself. You should read the following documents if you are interested in learning the basics of shell scripting.

1. BASH Programming – Introduction HOW-TO : This tutorials intends to help you to start programming basic-intermediate shell scripts. It does not intend to be an advanced document.

2. Advanced Bash-Scripting Guide : An in-depth exploration of the art of shell scripting. A must read to master bash shell scripting for all Unix users.

3. Learn Bash In Y Minutes : A quick tour of bash programming language.

4. BASH Frequently Asked Questions : Greg’s Wiki includes answers to many bash programming problems in Q & A format.

5. Linux Shell Scripting Tutorial : A beginners bash shell scripting handbook for new Linux users, sysadmins and school students studying Linux/Unix or computer science.

6. Bash Hackers Wiki : This wiki provide human-readable documentation and information for bash includes tons of examples.

7. Google’s Shell Style Guide : A thorough and general purpose understanding of bash programming by Google.

8. bash — Standard Shell : A thorough understanding of bash programming for Gentoo developers by Gentoo project.

10. Bash By Examples Part I, II, and III : Fundamental programming in the BASH where you will learn how to program in bash by example.

11. Bash Guide for Beginners : This is a practical guide which, while not always being too serious, tries to give real-life instead of theoretical examples.

12. Unix Shells: Bash vs Fish vs Ksh vs Tcsh vs Zsh : Great comparison cheat sheet for various Unix shells.

13. General coding style guide : This will help to make your code more readable.

14. Better bash scripting in 15 minutes : These tips and tricks will make you better at bash shell scripting.

15. Defensive bash programming : Learn how to defend your bash programs from breaking, and keep the code tidy and clean with these useful tips.

16. Shell scripting primer from Apple developer portal. Take a look at Shell script security chapter for more info.

17. Learning the bash Shell: Unix Shell Programming (In a Nutshell (O’Reilly) : O’Reilly’s bestselling book on Linux’s bash shell is at it again.

18. Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus : UNIX expert Randal K. Michael guides you through every detail of writing shell scripts to automate specific tasks. Each chapter begins with a typical, everyday UNIX challenge, then shows you how to take basic syntax and turn it into a shell scripting solution.

19. This guide aims to aid people interested in learning to work with BASH. It aspires to teach good practice techniques for using BASH, and writing simple scripts. A new version of this guide is currently being drafted.

Have a favorite online bash tutorial or new books? Let’s hear about it in the comments below.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 14 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
14 comments… add one
  • tull May 17, 2015 @ 23:06

    Please stop promoting horrible guides that teach unsuspecting newcomers to write bugs and not scripts.

    • Dan okellz May 18, 2015 @ 10:28

      :O is this whats its all about or you hating on it?

      • tull May 18, 2015 @ 15:35

        I don’t understand your comment but I would stay away from all but #4 and #6.

        • Dan okellz May 20, 2015 @ 10:17

          why is that so? mind filling me on them since i’m a noob in this

  • Lars Moelleken May 17, 2015 @ 23:42

    I think everybody who writes code (also beginners) should take a look at code-style-guides!

    e.g.: some month ago I added some content to the oh-my-zsh wiki: https://github.com/robbyrussell/oh-my-zsh/wiki/Coding-style-guide

    • Tobias Hochgürtel May 18, 2015 @ 12:21

      I agree with Code-Style Guides. Github can now support creators with Merchandise – nice to see :-)

    • 🐧 nixcraft May 19, 2015 @ 5:04

      The post has been updated. Thanks!

  • Dan okellz May 18, 2015 @ 10:28

    bookmarked.. i am always looking for sites that enable me to get this linux coding business in order

    • janet.tovar Jul 26, 2015 @ 12:58


  • Andrew Aug 28, 2015 @ 1:27

    Thank you for sharing the links related to Bash Scripting. I’m working on this now. Your website is a great source for new users trying to learn and understand everything Linux!

  • dedeibel Jan 5, 2017 @ 10:03
  • neutronscott Jan 6, 2017 @ 0:47

    All you need is the Bash guide from http://mywiki.wooledge.org/BashGuide

    The rest is mostly garbage and bad practice. This is put together by the guys in #bash on freenode

    • dgs Jan 7, 2017 @ 18:56

      nice source.. thank you!!

  • Joshua Mendoza Jan 6, 2017 @ 16:09

    Do you have a curated list of guides for ZSH?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum