Recommended Reading
What is the Best Way to Count Files in a Directory?
Learn how to count the number of files in a directory using the Linux command line ls, find, and a native bash shell solution with globs and arrays.
What's New in Focal Fossa Ubuntu 20.04 LTS?
Ubuntu 20.04 LTS is available for download. Find out some of the major security and performance improvements from this new distribution, including the introduction of WireGuard VPN, upgraded suite of software packages, faster boot time, etc.
How To Format Date and Time in Linux, macOS, and Bash?
This guide covers how to format date and time in Linux, Mac, and the Bash shell. Includes how to do date shell operations like adding days or comparing dates.
How To Do Advanced Math Calculation Using bc?
Learn how to use the GNU Linux bc command line to do math arithmetic and algebra with square root, sine, cosine, tangent, arctangent, bessel, and more.
All Mastering Linux with Tips and Tricks
Common Bash Error Messages on Linux and macOS (and How to Fix Them)
What common Bash errors mean and how to fix them: command not found, permission denied, bad substitution, ambiguous redirect, and more.
How To Calculate IP Subnets and Netmasks in Linux and macOS?
How to convert between CIDR prefixes and netmasks, and calculate network, broadcast, and usable host ranges with ipcalc, sipcalc, python3, and Bash.
Find, Filter, and Count Text: How to become a badass with Grep
All you need to know to be efficient with grep for searching line matching a regular expression pattern.
What is the Best Way to Count Files in a Directory?
Learn how to count the number of files in a directory using the Linux command line ls, find, and a native bash shell solution with globs and arrays.
What are the Differences Between Vi and Vim?
Vi vs Vim: A review of the main differences between the Vi/Ex POSIX standard and the Vim implementation.
sudo: no tty present and no askpass program specified
Learn what is askpass and how to solve the 'sudo: no tty present and no askpass program specified' error when using sudo to execute a command.
How To Format Date and Time in Linux, macOS, and Bash?
This guide covers how to format date and time in Linux, Mac, and the Bash shell. Includes how to do date shell operations like adding days or comparing dates.
What's New in Focal Fossa Ubuntu 20.04 LTS?
Ubuntu 20.04 LTS is available for download. Find out some of the major security and performance improvements from this new distribution, including the introduction of WireGuard VPN, upgraded suite of software packages, faster boot time, etc.
How To Do Advanced Math Calculation Using bc?
Learn how to use the GNU Linux bc command line to do math arithmetic and algebra with square root, sine, cosine, tangent, arctangent, bessel, and more.
Disown a running shell process and reattach it to a new screen
This post cover the basics of shell jobs management and terminal screen sessions. It covers how to detach a running job from your current shell and how to attached it to a new TTY session.
Redirecting a stdout to a file using sudo and tee
Learn how to address a permission denied error when trying to edit a file on Linux and work around some sudo issues. This post include a simple vim tips to save changes to a file with sudo right from your editor.
sudo: sorry, you must have a tty to run sudo
Learn what is a tty and how to solve 'sudo: sorry, you must have a tty to run sudo' error when using ssh to execute a sudo remote command.
Linux sysctl configuration and tuning script
Legacy post providing a custom script to auto-tune your Linux kernel and sysctl options based on your server specifications.
Using losetup and dd to secure sensitive data
Legacy post on using dd and losetup to encrypt a block device and secure sensitive data.
Bind 9.5.0 - Patch dlz MySQL 5 for Auto Reconnect
Legacy post addressing connectivity issue from a Bind 9 server with the dlz MySQL driver to a MySQL 5 backend server. This post provides appropriate patch for the given software versions.
Choosing a filesystem for your Linux/Unix server
Review of various filesystems available on Linux and how to choose one for your workstation or production server.
Two common errors while starting Apache server on Linux
Legacy post discussing some common errors when starting or running an Apache server on Linux.
How to Reload or Change your current Shell?
Learn the basic steps to reload your Linux shell to apply your recent configurations changes. This post cover the POSIX exec builtin command in Bash and the GNOME shell.
Fine tuning a Linux Apache MySQL PHP (LAMP) server
Legacy post discussing how to tune a production system using Linux, Apache, MySQL, and PHP (aka LAMP).
Removing ^M in imported Windows files
Learn how to quickly and easily handle files with newline and carriage return between linux, mac, and windows. This post will explain how to remove or replace the often annoying ^M character.
How to manage an idle ssh connection ?
Quick and simple tips on how to handle an idle remote ssh connection from your terminal.
Raid 5 Monitoring on Dell Power Edge 2650 with afacli
Case study on monitoring a Raid 5 array on Dell PowerEdge 2650 with a PERC3/Di by using afacli on Debian.
Linux is the kernel Linus Torvalds first released in September 1991. What you actually run is a distribution built around it — the kernel, a GNU userland, an init system, and a package manager. Most of what follows holds on any of them, because the tools are the same whether you are on Debian, Ubuntu, RHEL, or Alpine.
This section covers the parts of that userland you end up fighting with:
formatting dates and timezones,
searching with grep,
counting files in a directory without being
lied to by ls,
arbitrary-precision math with bc,
subnets and CIDR netmasks,
and
tuning sysctl on a
server that has run out of headroom.
It also covers the errors. command not found, Argument list too long,
bad substitution, Killed —
what they mean and what causes them
— along with the two sudo failures that show up in every CI pipeline sooner
or later:
no tty present
and
sorry, you must have a tty to run sudo.
