A traditional source for learning bash as a beginner is from the linux document project here:Hello, I was wondering if anyone knows a good place to start bash scripting. I am just trying to learn it to be more flexible with the OS.
Thanks in advance, ovtback
Thanks alot.The best way is to get some idea about what to script and then start scripting.
You'll learn by the way.
As for resource to get you quickly started here is good one, very concise and to the point, all you need to know on 1 page:
![]()
Bash scripting cheatsheet
Variables · Functions · Interpolation · Brace expansions · Loops · Conditional execution · Command substitution · One-page guide to Bash scriptingdevhints.io
What are your thoughts on platforms like Codecademy? Are they a waste of money or somewhat worth learning these types of materials on?A traditional source for learning bash as a beginner is from the linux document project here:
It's old now, but still a useful resource to begin with.
Up-to-date docs which are also from a sound source are here, but a little more advanced:
This guide is also available as a pdf from a link on the site.
The canonical bash guide is probably this one:
It's by Chet Ramey, the current developer.
There are numerous resources online showing bash scripts from simple to complex so it's worth searching at times if one is looking for a script for a specific outcome. There's also the AI sites where one can describe in ordinary language what one wishes for a script to do, and it will usually write one. Then one ought to check the script thoroughly because AI can be rather cursory, inaccurate, or mistaken.
Basically, to learn bash scripting, one ought to write scripts and keep writing and amending them until they work as intended.
Thanks a lot, really encouraging. Did you self learn everything computer related, or just specifically stuff like scripting?Me, I'm completely self-taught. It's probably why my scripting is 'untidy' & messy. Not the kinda thing I really want to share with the world!
Nah, it's nowhere near as bad as I like to make out.....but I've had no formal training, nor even followed any kind of generally recognised or 'semi-official' guide. In the course of researching summat else, I came across a tech blog article that was demo-ing some very simple examples.....so just for the hell of it, I tried 'em.
I have to say, I was intrigued by the possibilities that suddenly opened up!
I've always researched what I'm trying to do 'on-the-fly', as & when I need it. I'll copy examples, try 'em out. If they don't quite do what I want, having now got several years experience under my belt, I'll modify 'em, try 'em out again.....see what now happens. IF they then do what I want, they'll get incorporated into a longer script....
We build an awful lot of our own, home-brewed utilities for use in the 'Puppy' Linux community. In so doing, we tend to add GUI interfaces into them, especially to make them as simple as possible for 'noobs' and Windows 'refugees'.....and for these we either use the traditional gtk-dialog OR - my favourite - YAD (Yet Another Dialog), forked from the original Zenity project many years ago.
I find gtk-dialog - although it's considerably more powerful - to be an absolute PITA to code; it'll take several lines of code to define a single piece of the GUI, where YAD will often achieve it in a single short statement of just a few words.......because most of its functions are pre-defined, whereas with gtk-dialog, you start from a blank canvas & have to define EVERYTHING from the ground up.
But that's more 'advanced' stuff, for when you have some experience under your belt.
~~~~~~~~~~~~~~~~~~
All I will say is this; have a 'play'. Find examples online, copy them into your terminal. Run them. See what they do. Experiment. Keep on trying stuff out; when you find stuff that does something you know you'll find useful, make a note of it. I've got simple text files full of 'notes' and 'jottings' that I've scribbled down over the years.
As you become more experienced, you'll find yourself referring to your 'notes' less and less; you begin to remember a lot of this stuff. You'll be surprised just how often you find yourself re-using the same constructions & snippets of code, over & over again.....just strung together in different ways But never, EVER be afraid to research new & different ways of doing things. Bash is as complex and full of nuances as any other language you can learn.....and like any other language, it CAN take a lifetime to become fully and completely competent in it.....because - like any other language - it's constantly evolving.
I treat all this stuff as a hobby. I'm forever putting little scripts together just to automate small but repetitive tasks I'd done manually up until that point. Linux is fun like that; I dare say you COULD achieve the same outcomes under Windows, but the process wouldn't be anywhere near as enjoyable!
Remember; we're none of us 'expert' in Linux. We're ALL 'noobs' to a greater or lesser degree.....because there's always something new to learn. NEVER stop learning! And whatever else ya do, ALWAYS make sure to 'have fun' while you're at it....
Mike.![]()
I read a very tiny portion, but I will look through it thoroughly later on. Thank you.I certainly don't want you to take this the wrong way. The man page for bash has been very helpful to me. I would highly suggest reading through it, or at least some parts of it. It is very informative. Aside from that, create a homework assignment. Think about something you want your script to do and then try to find a way to do it in bash. Reading the man page first is recommended so you get an idea of what bash is capable of.
Signed,
Matthew Campbell
Thank you as well for this, I will definitely check these forums out.@ovtback , we have an in-house resource available on this subject that might be worth taking a look.
If you take a look at our front page, you will see articles from our main Staff Writer, Jarret Buse.
![]()
If you then go to our Search facility near top right and open it, search for
bash scripting
Posted by (start typing and it will autocomplete)
jarret
The output will contain a series from 1 to 9 on Bash Scripting.
HTH
Chris Turner
wizardfromoz
(surprised no one else suggested this)
BTW questions on scripting should be asked in Command Line, I will move this thread there.
Just had a brief look at Codeacademy, subscribed, but couldn't find a specifically bash course but there looks to be plenty on coding there. Can't say what they cover extensively without further investigation.What are your thoughts on platforms like Codecademy? Are they a waste of money or somewhat worth learning these types of materials on?
Totally self-taught, right from the word go. I date back to the early days of the "home computer revolution" - late 70s/early 80s. Unlike many of today's younger GenZ/Millennial crowd, who've only ever known this stuff to always be there, I was growing up alongside the industry as the breakthroughs & 'milestone' developments actually happened, and have watched the tech world develop and evolve in ways that I never quite expected to see!Thanks a lot, really encouraging. Did you self learn everything computer related, or just specifically stuff like scripting?