Command Line

Command Line

Running Processes In The Background: Best Practices And Pitfalls

Launching Background Processes A background process runs without blocking the shell, allowing the user to continue typing commands at the prompt while the process executes. The shell does not wait for background processes to finish before prompting for further input. Contrast this with foreground processes, which fully occupy the shell terminal – no new commands…

Preventing Processes From Being Killed: An Overview Of Nohup And Disown

The Problem: Processes Getting Killed on Logout When a user logs out of a Linux/UNIX system, the shell and associated processes are disrupted. Any foreground processes the user started are sent the HUP (hangup) signal by the shell. This signal causes processes to terminate by default. Background processes not disowned also receive HUP and may…

When To Use Nohup Vs Disown For Long-Running Processes

The Core Difference Between nohup and disown The Linux utilities nohup and disown both allow processes to continue running in the background after a user logs out or closes their terminal. However, nohup and disown achieve process persistence through different mechanisms: nohup configures a process to ignore SIGHUP signals, which are sent to processes when…

Demystifying Background Processes: Nohup, Disown And & Explained

Keeping Processes Running After Terminal Closure When a shell session is closed or a terminal window is exited, any processes started in that session are also terminated by default. However, often we want processes to continue running in the background even after closing the terminal. There are several methods in Linux to achieve this: nohup…

Unicode And Special Characters In Command Substitution

Escaping Special Characters in Bash The Bash shell allows command substitution, which substitutes the output of a command in place of the command itself. However, this can cause issues when the output contains special characters that have meaning to the shell itself. Special characters like spaces, tabs, newlines, slashes, brackets, and parentheses may be interpreted…

Live Cd Tools And Methods For Data Recovery On Linux

Booting into a Linux Live Environment A Linux live CD, DVD, or USB drive allows booting into a temporary Linux operating system without installing anything on the hard drive. This allows full access to drives and filesystems to attempt data recovery without risk of overwriting deleted files on the disk. Creating a Bootable Live USB…

Stopping Disk Writes Immediately After Accidental File Deletion On Linux

Understanding File Deletion in Linux When a file is deleted in Linux, the operating system does not immediately erase the data. Instead, it removes the file’s entry from the file system index and makes the storage sectors containing the file’s data available for future writes. Until those sectors are overwritten by new files, recovery of…

Using Testdisk And Photorec For Data Recovery On Linux

Losing important data is a dreadful situation for any Linux user. Fortunately, open source tools Testdisk and Photorec provide powerful capabilities for recovering lost or deleted files from Linux file systems and storage devices. Testdisk specializes in recovering lost partitions and rebuilding partition tables, while Photorec ignores disk structures and aims to extract every recoverable…

Recovering Accidentally Deleted Files On Linux: A Step-By-Step Guide

Finding Out What’s Been Deleted When a file disappears without explanation on a Linux system, the first step is to investigate where it might have gone. There are two approaches to tracking down recently deleted files: Checking the trash folder Many Linux distributions have a trash or recycling bin feature that retains deleted files for…