Recover Deleted Files on Linux: First Steps
Practical first steps for recovering deleted files on Linux, including stopping writes, imaging the device, recovery tools, and SSD/TRIM limitations.
Practical first steps for recovering deleted files on Linux, including stopping writes, imaging the device, recovery tools, and SSD/TRIM limitations.
umount detaches a mounted filesystem from the Linux directory tree. It is commonly used for USB drives, external disks, network mounts and temporary mount points. Check mounted filesystems Unmount by mount point This unmounts the filesystem currently attached at /mnt/backup. When the device is busy If unmounting fails with a busy message, check which process … Read more
The printenv command prints environment variables for the current shell session. These variables can affect paths, language settings, application configuration and script behaviour. Show all environment variables Show one variable This is useful when troubleshooting scripts that behave differently for different users or services.
Modern notes on shred, secure file deletion, SSD wear levelling, snapshots, encryption, and device sanitisation.
The md5sum command calculates an MD5 checksum for a file. It is useful for basic file comparison, but it should not be used for modern security-sensitive verification. Create a checksum Save and check a checksum For stronger verification, prefer SHA-256 checksums when they are available.
sum prints a simple checksum and block count for a file. It is an older utility and is mostly useful when working with legacy scripts or older Unix-style examples. Check a file For modern file verification, prefer stronger tools such as sha256sum where available.
Shell scripts are convenient, but they are a poor place to store passwords, API keys, or other long-lived secrets. Obfuscating or compiling a shell script does not provide strong secret protection because the secret must still become available to the running process. Prefer secret storage over script encryption Use a dedicated secret manager when one … Read more
The locale command shows the language, character encoding and regional settings used by the current shell session. Locale settings can affect sorting, dates, currency, messages and text handling. Show current locale Useful checks Locale mismatches are common causes of unexpected character display, sorting differences, or script output changes.
The sha1sum command calculates a SHA-1 checksum for a file. It can be useful for basic file comparison, but SHA-1 is no longer preferred for security-sensitive verification. Create a checksum Save and verify For modern downloads, use SHA-256 checksums when provided by the project or vendor.
The cksum command calculates a CRC checksum and file size. It is useful for simple integrity checks, especially when comparing whether two files are exactly the same. Basic use The output includes the checksum, byte count and file name. For download verification, prefer stronger checksums such as SHA-256 when available.