Check These Out
A simple directive which disables all aliases and functions for the command immediately following it. Shortcut for the bash built-in 'command' - "command linefoo".
Think, {sic}...
Generates a random 8-character password that can be typed using only the left hand on a QWERTY keyboard. Useful to avoid taking your hand off of the mouse, especially if your username is left-handed. Change the 8 to your length of choice, add or remove characters from the list based on your preferences or kezboard layout, etc.
Joker wants an email if the Brand X server is down. Set a cron job for every 5 mins with this line and he gets an email when/if a ping takes longer than 3 seconds.
Create a bash script to change the modification time for each file in 'files.txt' such that they are in the same order as in 'files.txt'
File name for bash script specified by variable, 'scriptName'. It is made an executable once writing into it has been completed.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Far from my favorite, but works in sh and with an old sed that doesn't support '-E'
The (in)famous "FizzBuzz" programming challenge, answered in a single line of Bash code. The "|column" part at the end merely formats the output a bit, so if "column" is not installed on your machine you can simply omit that part. Without "|column", the solution only uses 75 characters.
The version below is expanded to multiple lines, with comments added.
for i in {1..100} # Use i to loop from "1" to "100", inclusive.
do ((i % 3)) && # If i is not divisible by 3...
x= || # ...blank out x (yes, "x= " does that). Otherwise,...
x=Fizz # ...set x to the string "Fizz".
((i % 5)) || # If i is not divisible by 5, skip (there's no "&&")...
x+=Buzz # ...Otherwise, append (not set) the string "Buzz" to x.
echo ${x:-$i} # Print x unless it is blanked out. Otherwise, print i.
done | column # Wrap output into columns (not part of the test).
You can specify a range via '-'.