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

Open source now part of Romania’s Digital Agenda

All of Romania’s public administrations are to use open source and open standards software. The government is making this a (minute) part of the 2014-2020 Digital Agenda, made public in November. The approach will increase interoperability of ICT systems. Read more

GNU Binutils 2.25 Released With Port To Andes NDS32

The Binutils 2.25 changes include support for the Andes NDS32 architecture and new --data, --include-all-whitespace, and --dump-section options. Among the changes for GNU ld in Binutils 2.25 is support for the Andes NDS32 architecture, support for the OpenRISC and OR32 has been replaced with the OR1K port. Gas for Binutils 2.25 has support for AVR Tiny micro-controllers, support for the NDS32, and enhanced ARM support. The NDS32 enablement within the GNU stack has been going on for a while with last year GCC seeing a port to this architecture, etc. The NDS32 from Andes Technology is a 32-bit CPU architecture designed for embedded environments using the AndeStar ISA and the SoC processors are marketed under the AndesCore brand. Read more

2014 Year-End NVIDIA Linux Benchmark Comparison

For this article today, the major driver releases of the year for their mainline driver were benchmarked while ignoring some of the later drivers in each series that just shipped bug-fixes or new kernel / xorg-server support after a new driver series was already in beta or stable. The tested NVIDIA drivers for this article include the 331.38, 334.16, 337.12, 337.19, 340.17, 343.13, 343.22, 346.16, and 346.22 Linux x86_64 drivers. The 331 series was the last driver series from late 2013 for reference. The graphics card used for today's testing was a GeForce GTX 780 Ti (Kepler) graphics card as being a high performance GPU that's compatible with all of the driver releases tested throughout the year. Read more

Quadcopter drone packs first all-Linux APM autopilot

Erle Robotics launched a ROS-enabled, open source “Erle-brain” autopilot that runs APM directly on Linux. The device also powers an “Erle-copter” drone. Over the last year, Spanish firm Erle Robotics S.L. has been working with 3DRobotics to develop an open source BeaglePilot autopilot for drones that can run Linux on 3DR’s popular, Arduino-based APM (ArduPilot Mega) platform. The APM Linux port was developed by both companies, as well as several academic institutions. The BeagleBone-based “Erle-brain” autopilot is built into the $490-and-up Erle-copter quadcopter. Read more