Command Line

Command Line

Exploring Integer And Floating Point Math Options On Linux Command Line

Performing Basic Arithmetic with expr The expr command in Linux provides a way to perform basic integer arithmetic operations like addition, subtraction, multiplication and division. It takes integer arguments and evaluates the result of the given expression. Some of the key things expr can be used for include: Adding, subtracting, multiplying and dividing integers Using…

A Comparison Of Linux Math Tools For Command Line Calculations

Performing Math on the Linux Command Line The Linux command line provides access to several powerful built-in tools that can be used for mathematical calculations and analysis. This includes programmable calculator languages like bc, pattern scanning languages like awk, and general purpose programming languages like Python that have extensive math support. Each tool has its…

Troubleshooting Login Vs Non-Login Shells On Linux

Determining Your Shell Type Identifying whether you are using a login shell or an interactive non-login shell is key to troubleshooting issues with your shell environment setup and configuration. There are a few methods to definitively determine what type of shell instance you are currently utilizing. Identifying login vs interactive shells When a user first…

Reattaching Disowned Processes In Linux And Unix

In Linux and Unix operating systems, processes can become “disowned” from their controlling terminals. This often happens unintentionally when using job control features of shells like Bash. Disowned processes continue running in the background, but they no longer accept signals from the shell. This article explains what disowned processes are, how to find them, and…

Redirecting Output To Files You Don’T Have Write Permissions For

Understanding File Permissions File permissions are important for system security and user privacy. As users, we should understand and respect the permission settings on files we access. Handling “Permission Denied” If you try to access a file and get a “permission denied” error, there are proper procedures to request access: Contact the file owner or…

When And Why To Use Interactive Vs Non-Interactive Shells

What are Interactive and Non-Interactive Shells? An interactive shell allows a user to directly execute commands and view output in real-time. Common examples include bash, zsh, and other Linux/UNIX shells accessed via a terminal or command line interface. Users can explore data, prototype code, and convenient everyday tasks through immediate feedback. A non-interactive shell executes…

Tmux For Session Sharing And Process Reattachment

Getting Started with Tmux Installing and launching tmux Tmux is a terminal multiplexer that allows multiple terminal sessions to be accessed simultaneously in a single window. To get started with tmux, first install it on your system with your package manager of choice. On Linux: $ sudo apt install tmux #Ubuntu/Debian $ sudo yum install…

Properly Escaping Special Characters For Cross-Platform Sed Usage

Why Escaping Metacharacters Matters Sed is a powerful stream editing utility available on Unix-like platforms that allows users to perform text transformation and substitution operations on streams and files. At the core of sed’s functionality is its ability to match text patterns for editing using regular expressions. However, many common characters that are regular expression…

Emulating Gnu Sed Functionality On Macos

What is GNU Sed and Why Use It? The GNU implementation of the Linux stream editing utility sed, commonly referred to as GNU Sed, offers advanced regular expression manipulation capabilities compared to the default BSD sed included in macOS. GNU Sed includes several additional features, commands, and extensions that grant users more control over matching…

Using Basic Vs. Extended Regular Expressions In Sed

Definition and Background of Regular Expressions A regular expression (regex or regexp for short) is a sequence of characters that defines a search pattern. Regexes provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. They are supported by many text editors, programming languages, and…