Did you know Bash has got macros, a multi-clipboard, an undo feature, and a word completion based on history?
Source: Lesser Known Bash shortcuts (GitHub)
Did you know Bash has got macros, a multi-clipboard, an undo feature, and a word completion based on history?
Source: Lesser Known Bash shortcuts (GitHub)
Explains how to check if a bash shell script is being run or executed by the root user account under Linux, macOS, Unix and BSD.
Source: How to check the bash shell script is being run by root user or not – nixCraft
The following concepts modernize your automation scripts with some lesser-known modern Bash scripting techniques.
Source: 5 Modern Bash Scripting Techniques That Only A Few Programmers Know | Level Up Coding
This guide explains how to use date command in Bash scripting and how to work with date and time in shell scripts in Linux.
Source: Use Date Command In Bash Scripting In Linux – OSTechNix
When spending most of your day around bash shell, it is not uncommon to waste time typing the same commands over and over again. This is pretty close to the definition of insanity.
Luckily, bash gives us several ways to avoid repetition and increase productivity.
Today, we will explore the tools we can leverage to optimize what I love to call “shell time”.
Source: Boost Up Productivity in Bash – Tips and Tricks | Linux Journal
Minimal Bash script template that will make your scripts safer, consistent with standards, and provide a way to parse and validate parameters.
Writing shell scripts leaves a lot of room to make mistakes, in ways that will cause your scripts to break on certain input, or (if some input is untrusted) open up security vulnerabilities. Here are some tips on how to make your shell scripts safer.
Source: Writing Safe Shell Scripts (MIT Student Information Processing Board)
Most guides to bash history shortcuts exhaustively list all of the shortcuts available to you.
The problem I always had with that was that I would use them once, and then glaze over as I tried out all the possibilities. Then I’d move onto my working day and completely forget them, retaining only the well-known !! trick I learned when I first started using bash.
So most never got committed to memory.
Here I outline the shortcuts I actually use every day.
Source: Seven God-Like Bash History Shortcuts You Will Actually Use – zwischenzugs
If you’ve ever used a spreadsheet, you’ve probably used or seen functions for doing date math—in other words, taking one date and adding some number of days or months to it to get a new date, or taking two dates and finding the number days between them. The same thing can be done from the command line using the lowly date command, possibly with a little help from Bash’s arithmetic.
Source: Doing Date Math on the Command Line, Part I | Linux Journal
Source: Doing Date Math on the Command Line – Part II | Linux Journal
I call this the unofficial bash strict mode. This causes bash to behave in a way that makes many classes of subtle bugs impossible. You’ll spend much less time debugging, and also avoid having unexpected complications in production.
Source: Use the Unofficial Bash Strict Mode (Unless You Looove Debugging) (aaron maxwell)
GiottoPress by Enrique Chavez
Recent Comments