Author: The Aha Unix Team

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…

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…

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…

Securing Your Linux System Through Proper Shell Configuration

The Secure Shell (SSH) protocol allows remote login access and command execution on Linux systems. While extremely useful, SSH can also pose a security risk if not properly configured. By tweaking SSH server settings and hardening user accounts, administrators can dramatically improve the security posture of Linux machines against attacks. Limit Access Through SSH Configuration…

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…

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…

Combining Multiple Conditions In Bash Script Conditionals

Checking Multiple Conditions in if Statements Bash scripts often need to check multiple conditions before executing commands. The bash if statement allows checking multiple conditions using Boolean operators AND and OR. The AND operator (&&) evaluates as true if both the conditions on either side of it are true. The OR operator (||) evaluates as…

Whitespace Matters: Avoiding Syntax Errors In Bash Conditionals

Bash conditionals allow scripts to make decisions and execute code conditionally based on the status of files, variables, and other criteria. However, these powerful tools come with rigid syntax rules that are easy to violate if spacing is not meticulous. Innocent-looking spaces, tabs, and trailing whitespace can lead to frustrating errors that cause bash scripts…

Using Case Statements To Simplify Conditional Logic

Reducing Complexity with Case Statements Conditional logic is ubiquitous in programming. We often need to execute different code blocks based on the state of variables or the flow of program execution. However, nested if-else statements and chained conditional logic can quickly become complex and hard to reason about. Case statements provide a way to simplify…

Headless Server X11 Forwarding To Local Display Using Ssh Port Tunneling

Enabling X11 Forwarding on SSH Server The first step in setting up X11 forwarding from a headless Linux server to your local machine is to enable X11 forwarding in the SSH daemon’s configuration file on the server. By default, X11 forwarding is disabled for security reasons on most SSH server implementations. On a Linux system…