How to Exit if a Bash Variable in Not Set
Sometimes you might want to exit a command if a variable is not set in Bash.
You can do this as follows:
if [ -z "$VARIABLE_NAME" ]; then echo …
Read Article →
45 articles about linux development, tools, and best practices
Sometimes you might want to exit a command if a variable is not set in Bash.
You can do this as follows:
if [ -z "$VARIABLE_NAME" ]; then echo …
Read Article →
If you need to check the version and flavour of the running Linux instance, then you can try the below commands:
cat /etc/os-release
lsb_release -a …
Read Article →
You have 3 options here:
tee
with sedsed 's/Hello/Hi/g' file-name | tee file
>
with sedsed …
Read Article →
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
command-line tool to …
You can download and install the AWS CLI on Linux as follows:
curl …
Read Article →
If you need to reboot, or restart the networking interface on your Mac, by using the CLI, then you can issue the following commands:
If you have come across the following error:
ZipArchive extension: <strong>disabled/not installed</strong>
This just means that …
Read Article →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
.
touch -t …
Read Article →
If you need to query meta-data
information from your running EC2 instance, you can curl the following location:
curl …
Read Article →
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 can use the following …
Read Article →Upgrading an Ubuntu Server is quite easy, just follow the below commands:
sudo apt-get update && sudo …
Read Article →
If you need to generate a random AlphaNumeric string from the Linux/MacOS Command-Line, then you can use the following script:
dd if=/dev/random bs=8 …
Read Article →