Check These Out
The command tasksel allows the choice of packages from the command line to get predefined configurations for specific services (usually this option is offered during installation).
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name.
i.e.: logfile.1.gz > logfile.2.gz
I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.
Fool date by setting the timezone out by 24 hours and you get yesterday's date. Try TZ=XYZ-24 to get tomorrow's date. I live in TZ=GMT0BST so you might need to shift the number 24 by the hours in your timezone.
Awk replaces every instance of foo with bar in the 5th column only.
The backtick operator, in general, will execute the text inside the backticks. On OS X, the pbpaste command will put the contents of the OS X clipboard to STDOUT. So if you put backticks around pbpaste, the text from the OS X clipboard is executed.
If you add the pipeline | pbcopy, the output from executing the command on the clipboard is placed back on the clipboard.
Note: make sure the clipboard is text only.
Useful if you have to put together multiple files into one and they are scattered across subdirectories. For example: You need to combine all .sql files into one .sql file that would be sent to DBAs as a batch script.
You do get a warning if you create a file by the same extension as the ones your searching for.
find . -type f -name *.sql -exec cat {} > BatchFile.txt \;
-L is for following symbolic links, it can be omitted and then you can find in your whole / dir
curl -sLkIv --stderr - https://t.co/2rQjHfptZ8
-s: silences the output when piped to a different command
-L: follow every redirect
-k: ignores certificate errors
-I: just request the headers
-v: be verbose
--stderr - : redirect stderr to stdout
https://t.co/2rQjHfptZ8: URL to check for redirects
piped to
grep -i location:
-i: grep target text ignoring case
location: : greps every string containing "location:"
piped to
awk {'print $3'}
prints the third column in every string
piped to
sed '/^$/d'
removes blank lines
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"