UNIX

df command examples on Linux macOS BSDWe use the df command to find total disk space and available space on a Linux / Unix file system. Let us see how to use the df command to view the amount of free space left on your Linux, macOS, *BSD and Unix file system. We will also explain how to automate disk space monitoring and send an email alert or push notification to your mobile device.
[continue reading…]

I need to set a bash environment variable called PURGEIMAGE and take specific actions in my script. For example, if PURGEIMAGE set, then purge images from CDN else just URL. I am going to call my script as PURGEIMAGE=yes ./purgecache.sh url1 url2. So how do I know if a bash variable set at the CLI and used in my bash script running on Linux or Unix-like systems?
[continue reading…]

Homebrew is an essential package manager for developers, sysadmins, and power users on macOS. Homebrew allows us to install the latest and updated version of popular applications, packages, and developer tools. Homebrew is the painless way to install required packages on your Mac. For instance, we can install PostgreSQL, Python, PHP, Bash, Nginx, Apache, and much more using brew command. This page explains how to install and use Homebrew on the macOS system to get missing packages. Homebrew installs the apps you need that Apple didn’t include in their base operating system or app store.
[continue reading…]

I have two columns (fields) in my text file. I am trying to insert ‘| FOO This is a description
BAR Another description for bar
TEXT Another description for TEXT

So I ran awk '{ print $1 "|"; $1=""; print}' input > output but print command is adding a new line:
FOO|
This is a description
BAR|
Another description for bar
TEXT|
Another description for TEXT

Is there any way to tell awk not to print a newline and create the file? Here is what I want so that I can create final HTML table based upon ‘|‘:
FOO|This is a description
BAR|Another description for bar
TEXT|Another description for TEXT

[continue reading…]