Category: Shell Commands and Automation

Practical shell commands for everyday work with Unix/Linux systems – great for sysadmins, developers, and automation.

  • VSCode DevContainer loads wrong .zshrc and writes history into /tmp

    When working with Visual Studio Code DevContainers and using zsh as your default shell, you may encounter an annoying issue: instead of loading the familiar ~/.zshrc and writing history to ~/.zsh_history, VSCode suddenly uses a temporary directory such as /tmp/xyz-code-zsh/.zsh_history. As a result, important shell settings are lost and your history is no longer persistent.

    (more…)
  • Full Linux System Backups with the dd_image.sh Script – Compressed, Remote, Automated

    Repository: https://github.com/andreas-schwab-swx/dd_image

    If you’re looking for a simple yet powerful solution for full disk image backups on Linux, the dd_image script offers a versatile tool: it creates complete disk images, compresses them on-the-fly, and transfers them automatically via SSHFS to a remote server – with logging, retention logic, and optional notifications.

    Features at a Glance

    • Full disk backups using dd
    • On-the-fly compression with xz
    • Remote storage via sshfs
    • Automatic cleanup of old backups
    • Progress monitoring and detailed logging
    • Prevents concurrent runs using a lock file
    • Optional email notifications on success or failure
    • Optional zero-fill for better compression
    (more…)
  • grep Cheatsheet

    This overview summarizes the grep commands I frequently use to search for text in files.

    (more…)