Get all your news in one place.
100's of premium titles.
One app.
Start reading
Tom’s Hardware
Tom’s Hardware
Technology
Les Pounder

Automate common and boring tasks with Bash Scripts in Linux

A fake terminal image on top of a real terminal output background.

Historically, operating systems generally come with some form of scripting language which admins and power users can use to create custom tools. Harking back to the home computer craze of the 1970s and 80s, this was BASIC (Beginners All-Purpose Symbolic Instruction Code) but in recent years we have seen batch scripts (I used these for my 486 DX 33 too eek out as much RAM as possible to play Star Wars: X-Wing). Unix and Linux are no different and come with their own scripting languages, one of which is baked into the terminal. These simple to create, yet fiendishly powerful scripts can do everything from remotely backing up entire file systems to making an LED flash.

Bash scripts behave like those of other programming languages. The code runs line by line in a sequence. We can use conditional logic (selection) to alter the path that our code takes and the code can iterate and repeat the execution of the code until a condition is met or run the code indefinitely.

Sign up to read this article
Read news from 100's of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.