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

Today in Techrights

today's leftovers

  • Key Question: Is Bundling Proper?
    In both cases, bundling is either a restraint of trade or simply a wasted motion. You don’t paint a house green only to paint it red if you have any sense. The right way to do IT is to make your choice and buy/acquire what you need to accomplish your goals in the most efficient manner possible. Bundling exclusively That Other OS with all PCs was only good for an illegal monopolist and its “partners” in crime. This is not about denying businesses profits. It’s about competition in the market and freedom for users/buyers to have choice.
  • Dell Gets An Airplane Mode Switch Driver In Linux 4.2
  • Call for hosts for GUADEC 2016
    GUADEC is the biggest gathering of GNOME users and developers, which takes place in Europe every year. It includes conference days, the GNOME Foundation annual general meeting and hacking in a week of coding and discussion.
  • 4MLinux 13.0 Screencast and Screenshots
  • Tumbleweed is rolling again
    Opensuse Tumbleweed has been static since the 20150612 snapshot. But today the 20150630 snapshot was released. We are moving again.
  • openSUSE Tumbleweed net-tools vs net-tools-deprecated
  • PostgreSQL 9.5 in Debian
    The package is also waiting in NEW to be accepted for Debian experimental.
  • DUCK challenge at DebConf15
  • Upgrades to Jessie, Ruby 2.2 transition, and chef update
    Last month I started to track all the small Debian-related things that I do. My initial motivation was to be concious about how often I spend short periods of time working on Debian. Sometimes it’s during lunch breaks, weekends, first thing in the morning before regular work, after I am done for the day with regular work, or even during regular work, since I do have the chance of doing Debian work as part of my regular work occasionally. Now that I have this information, I need to do something with it. So this is probably the first of monthly updates I will post about my Debian work. Hopefully it won’t be the last.
  • Avalue debuts Braswellian COMs and an SBC
    Avalue unveiled three Linux-friendly embedded boards based on Intel’s 14nm Braswell SoCs: a Qseven COM, a COM Express Type 6 COM, and a 5.25-inch SBC.
  • Tizen In-App Purchases(IAP) for Unity Applications goes Live!
  • 5 Best Enterprise Apps and Extensions for Google Chrome
    We have already covered a lot of enterprise applications on our site before. However, one would never expect apps in this genre to exist on a browser like Google Chrome. But, nothing could be further from the real truth. Google's effort to outsmart even the biggest players in the enterprise market are gradually paying off. Slowly spreading its wings into the business world, Google is venturing into arenas where Microsoft once reigned supreme. While the competition doesn't concern us much, but what has happened, in effect, is that the rivalry is bringing out the best in both companies.
  • Platform9 Aims to Control the Private Cloud from the Cloud [Video]
  • Teaching Email Self-Defense: Campaigns intern leads a workshop at PorcFest
    My workshop on Email Self-Defense took place at the 12th annual Porcupine Freedom Festival in Lancaster, New Hampshire. Around eight people attended, which was a few more than I expected. Christopher Waid and Bob Call of ThinkPenguin joined me in helping everyone who brought a laptop to set up GnuPG properly. Those who didn't bring a laptop participated by observing the process on the system most similar to their own and asking questions about particular steps, so as to enable them to achieve the same configuration when they returned home.
  • Security advisories for Thursday

Leftovers: Software

today's howtos