Language Selection

English French German Italian Portuguese Spanish

6 cool BASH tricks

Filed under
Software

In this article, I'm going to show you a number of simple, yet highly useful tricks that will make your scripting life easier. True, this article may appeal to the more geeky segment of my readers, but there's no reason to stop reading. As usual, I'll try to make my examples as simple and elegant as possible, with screenshots aplenty.

Scripts are an important part of Linux life. They are not necessary, but they can make your life easier by automating tasks. Most users will get along fine without ever bothering with scripts. But if you're lazy and would like your system to work hard rather than the other way around, learning how to write and use scripts is a good exercise.

BASH stands for Bourne Again SHell, the default Linux shell. If you're wondering what shell is, then think of its an interpreter between you (the user) and the system. You type in commands and the systems translates them into actual work. Most of the time, the results of this work are printed on your screen, inside the terminal.

Writing scripts is BASH can be as simple as entering commands one after another, then pasting them all into a text file that will become a script. Still, there are few tricks that can make a lot of difference.

Let's see them.




More in Tux Machines

Chromium and Firefox: New Features

  • Chromebook Owners Will Soon Be Able to Monitor CPU and RAM Usage in Real-Time
    Chromium evangelist François Beaufort announced today that Google's Chrome OS engineers have managed to implement a new feature that will let Chromebook owners monitor the CPU usage, RAM, and zRam statistics in real-time. The feature was implemented in the Chrome Canary experimental channel and can be easily enabled by opening the Google Chrome web browser and accessing the chrome://flags/#sys-internals flag. There you'll be able to monitor your Chromebook's hardware and see what's eating your memory or CPU during heavy workloads, all in real-time. "Chrome OS users can monitor in real-time their CPU usage, memory and zRam statistics thanks to the new internal page chrome://sys-internals in the latest Canary," said François Beaufort in a Google+ post. "For that, enable the experimental chrome://flags/#sys-internals flag, restart Chrome, and enjoy watching real-time resource consumption."
  • Tracking Protection for Firefox for iOS Plus Multi-Tasking in Focus for Android New Today
    Across the industry, September is always an exciting month in mobile, and the same is true here at Mozilla. Today, we’re launching the newest Firefox for iOS alongside an update for the popular Firefox Focus for Android, which we launched in June.

Ubuntu 17.10 (Artful Aardvark) Is Now Powered by Linux Kernel 4.13, GCC 7.2

Greg Kroah-Hartman published on Wednesday new maintenance updates for various of the supported Linux kernel branches that he maintains, including the Linux 4.12 series, which appears to have reached end of life. Read more

The ISS just got its own Linux supercomputer

A year-long project to determine how high-performance computers can perform in space has just cleared a major hurdle -- successfully booting up on the International Space Station (ISS). This experiment conducted by Hewlett Packard Enterprise (HPE) and NASA aims to run a commercial off-the-shelf high-performance computer in the harsh conditions of space for one year -- roughly the amount of time it will take to travel to Mars. Read more

Qt 5.6.3 Released

I am pleased to inform that Qt 5.6.3 has been released today. As always with a patch release Qt 5.6.3 does not bring any new features, just error corrections. For details of the bug fixes in Qt 5.6.3, please check the change logs for each module. Read more