TECH / ARCHIVE

Servers & Websites

TECH / Servers & Websites 2 min

How to Add a Delay in a Bash Script – Linux sleep Command (Seconds, Milliseconds & Loops)

Whenever you need to pause execution in a Linux or macOS bash script – waiting for a database to boot, spacing out API requests, or throttling a retry loop – use the built-in sleep command.

Linux bash sleep command delay examples

Quick answer: sleep 10 pauses a script for exactly 10 seconds. On Linux (GNU coreutils), sleep also accepts fractional seconds (0.5) and unit suffixes like m (minutes), h (hours), and d (days).

Read full article →

TECH / Servers & Websites 3 min

How to Install mc (Midnight Commander) on Ubuntu: Fix “Unable to locate package mc”

On a fresh Ubuntu Server install (18.04, 20.04, 22.04, or 24.04), running sudo apt install mc often throws E: Unable to locate package mc. The reason is simple: Midnight Commander lives in the universe repository, which is frequently disabled by default on minimal server images.

Installing Midnight Commander (mc) on Ubuntu via the universe repository

Quick install (3 commands): enable the universe repository, refresh the package index, and install mc:

sudo add-apt-repository universe
sudo apt update
sudo apt install -y mc

Read full article →