How to Save sed Output Directly to a File
You have 3 options here: Option 1: use tee with sed Option 2: use > with sed Option 3: use sed with -i option
You have 3 options here: Option 1: use tee with sed Option 2: use > with sed Option 3: use sed with -i option
If you find yourself in a position where you need to sync all emails from one account to another, then you can use the imapsync… Read More »How to Bulk Move All Email from One Account to Another using the CLI
You can download and install the AWS CLI on Linux as follows: Perform the install Verify the install
If you need to reboot, or restart the networking interface on your Mac, by using the CLI, then you can issue the following commands: Using… Read More »How to Reboot Networking on Mac from CLI
If you have come across the following error: ZipArchive extension: disabled/not installed This just means that you are missing the php-zip module. How to fix the… Read More »[Solved] ZipArchive extension: disabled/not installed on Ubuntu
If you have a file on your machine, and you want to change the created/modified time/date stamp, then you can use the touch command. In… Read More »How to Change the Timestamp of a File on Mac/Linux
If you need to query meta-data information from your running EC2 instance, you can curl the following location: This will provide a list of all… Read More »How to get Meta-Data information from an AWS EC2 Instance
If you need to view a list of all the services that are either running or stopped (or both) on an Ubuntu server, then you… Read More »How to List all Running Services on Ubuntu
Upgrading an Ubuntu Server is quite easy, just follow the below commands: Option 1: Tldr; (just run the below!) Option 2: Follow the steps to… Read More »How to Upgrade an Ubuntu Server
If you need to generate a random AlphaNumeric string from the Linux/MacOS Command-Line, then you can use the following script: This can also be piped… Read More »How to Generate a Random AlphNumeric String in Linux/MacOS
If you are getting the following error in MySQL:ERROR 1030 (HY000): Got error 168 from storage engine Then this usually means that your server has… Read More »[Solved] ERROR 1030 (HY000): Got error 168 from storage engine
On Linux, you can change the hostname by using the hostnamectl command. How to Set the Hostname on Linux For example: At this point, you… Read More »How to Change the Hostname on Linux
Certbot allows simple, quick and free provisioning of SSL certificates using LetsEncrypt. How to install Certbot Option 1 (recommended) Option 2 How to run Certbot… Read More »How to setup Certbot wildcard certificate on Apache
chmod alters the permissions for a file or directory, you could allow full read/write access to a file or directory by running the following command:… Read More »How to tell what the CHMOD value of a file/directory is
You may find your /var/log/journal directory taking up a lot of disk-space. How do you go about removing, or deleting all these files under var… Read More »How to cleanup a /var/log/journal in Linux
I needed to find all files in a directory on Linux that ended with the file extension .php. How to find all files in a… Read More »How to find all files in a directory with extension
Operating Systems come in a few competing choices, of which the major players are Apple’s MacOS, Microsoft’s Windows and then the various flavours of Linux,… Read More »Forensic Analysis on Linux (Unix)
It’s amazing how many times I’ve need to find out the total size of all the files in a directory on one of our servers.… Read More »Get the total size of all the files in a directory
So you are getting an error 404 or perhaps even worse, a 500! The error in your Apache2 logs looks something like this: ***.162.245.*** -… Read More »How to debug an Apache 404 error
If you’ve ever typed date into your Ubuntu Server and seen a different time or timezone appear than you expected, then it probably means that… Read More »How to Change the Timezone on Ubuntu Server
Programming languages provide the ability to remove special characters from a string quite easily. Sometimes you need to also do this from your command-line using… Read More »Remove Special Characters in a String using Bash
Let’s take a really common example. Say we want to follow redirects with cURL for google.com. It is common to curl follow redirect a URL.… Read More »How to Follow Redirects with cURL for CLI or PHP
I often need to test a specific Linux binary or make sure something works as expected from yum install or apt install. To do this,… Read More »How to use Docker to test any Linux distribution locally
There is a fantastic tool to see and monitor Bandwidth and Network Traffic on Linux. It’s called bmon and it works out of the box.… Read More »How to monitor Network Traffic on Linux
Screen on Linux is a popular command-line program that lets you multiplex between interactive shells. What that means is, you can use screen to save… Read More »How to use Screen on Linux