> A Couple Ways to Return a Random Number on the Command Line

Lets explore a couple ways to get random numbers on the command line. Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin. John von Neumann $RANDOM Bash Internal $RANDOM is an internal Bash function (not a constant) that returns a…

> Re-call Command Line Arguments in BASH

BASH's history expansion character, ! has many features, including !: for choosing a specific argument (or range of arguments) from the history. The gist is any number after !: is the number of the argument you want, with !:1 being the first argument and !:0 being the command. echo one two three one…

> Use Multiple CPU Cores(Parallelize) with Single Threaded Linux Commands

Note: If things are not working as described below check the version information for parallel. parallel --version WARNING: YOU ARE USING --tollef. IF THINGS ARE ACTING WEIRD USE --gnu. ... Either add --gnu to all your parallel commands, or edit /etc/parallel/config and make sure it lists --gnu and not…

> Advanced BASH Variable Usage

Basic Variable Usage $VARIABLE ${VARIABLE} BASH variables are case sensitive, e.g. $VARIABLE is not the same as $variable. The curly bracket syntax allows the variable name to be delimited from trailing characters that otherwise might be interpreted as part of the variable name: VARIABLE=end echo "The opposite of…

> What does "use strict;" in Perl do?

What does use strict; in Perl really get you? By default three things, which can be specified separately or turned off separately: # All on by default when using use strict; use strict "vars"; use strict "subs"; use strict "refs"; # One or more can be turned off if need be no…

> The Dangers of Copying and Pasting Commands from the Internet

What you see on a webpage isn't necessarily what you get when you copy something off it. Watch out for extra hidden logic, especially in "example commands" you might copy directly over to a prompt. The command below demonstrates the point, and is safe to run. It just doesn't do…