Author: The Aha Unix Team

Debugging Background Processes After Ssh Session Disconnect

Using Screen to Detach Processes The screen command allows users to detach interactive terminal sessions and reattach them later. This allows processes running within a screen session to continue executing even after disconnecting the SSH session that started it. To start a screen session, simply run the screen command. You will be presented with a…

Managing Long-Running Ssh Sessions With Tmux

Keeping SSH Sessions Alive with Tmux Tmux is a terminal multiplexer that enables multiple terminal sessions to be accessed and controlled from a single screen. By multiplexing the terminal, it is possible to detach and reattach terminal sessions while keeping the programs running in the background. This makes tmux ideal for managing long-running SSH connections….

Comparing Nohup, Disown And Backgrounding For Long-Running Ssh Processes

Keeping Remote Processes Running After SSH Session Ends When working on remote servers over SSH, initiating long-running processes can be problematic. By default, when the SSH session disconnects, the remote shell also exits, killing any child processes started in that session. Methods like nohup, disown, and backgrounding allow processes to continue running after the SSH…

Reconnecting To Background Processes With Gnu Screen After Ssh Session Disconnect

When working on remote servers over SSH, processes and tasks started in the SSH session will terminate when the network connection drops or the client disconnects. However, in many cases we want long-running processes, such as training machine learning models, downloading large files, or running computational workflows, to continue executing in the background after we…

Disk Usage 101: An Intro To Du, Df, And Tools For Analyzing Storage Utilization

Defining Key Terms: du, df, inode, storage utilization When managing a computer system, monitoring and understanding disk space usage is critical. There are some key terms and concepts to understand when analyzing storage utilization: du – Short for “disk usage”, this command provides statistics on disk space used by files and directories on your filesystem….

Improving Shell Script Reliability And Robustness

Handling Errors Gracefully Robust shell scripts anticipate, detect, handle and recover from errors gracefully. Instead of failing catastrophically, they continue working or fail safely. Several techniques help make scripts more resilient. Checking Return Codes to Detect Errors Most commands return an exit code indicating success or failure. By checking these return codes after critical commands,…

Finding Hidden Space Hogs: Identifying Deleted But Open Files And Other Disk Usage Oddities

Locating Open but Deleted Files Open deleted files refer to files that have been deleted from disk but are still held open by running processes. Although deleted, storage space cannot be freed up until all open file handles are properly closed. Identifying these open deleted files can help troubleshoot apparent disk space exhaustion issues. Using…

Demystifying Disk Space Usage: A Deep Dive Into Blocks, Inodes And File System Overhead

Describing key concepts – blocks, inodes, file system overhead Files systems are responsible for organizing and managing file storage on disks. To understand disk space usage, we need to get familiar with some key concepts like blocks, inodes and file system overhead. Blocks are minimum addressable block storage units used by file systems. A typical…

Managing Terminals And Consoles

Understanding Terminals and Consoles A terminal is a software program that provides text-based access for entering commands and viewing output from the operating system shell, applications, and other command-line interfaces. Common terminal emulators on Linux include xterm, gnome-terminal, konsole, and rxvt. Terminals do not manage their own display and input/output (I/O) streams but rather leverage…