{
  "id": 14699139,
  "title": "I was using rsync, find, sort, and tar wrong until I learned what their flags actually do",
  "url": "https://urgent.news/2026/10/15/i-was-using-rsync-find-sort-and-tar-wrong-until-i-learned-what-their",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-15T13:00:18.000Z",
  "source": {
    "name": "XDA Developers",
    "slug": "xda-developers",
    "url": "https://www.xda-developers.com/i-was-using-rsync-find-and-sort-wrong-until-i-learned-what-their-flags-actually-do/"
  },
  "original_language": "en",
  "account": "For years, I used rsync, find, sort, and tar commands without fully understanding their flags and options. This lack of knowledge often led to unintended consequences and inefficiencies. To better comprehend these commands, I set up a Debian 13 container alongside my home lab Proxmox Linux containers and tested them with four everyday terminal commands.\n\nIn rsync, the -a flag stands for archive mode, which includes seven other flags: -rlptgoD. This mode ensures that recursion, symlinks, permissions, times, group, owner, and devices are preserved during the copy process. Without -a, I had copied a folder multiple times, each time losing symlinks and resetting timestamps, resulting in an unreliable backup system.\n\nThe -delete flag in rsync turns it into a true mirror, creating an exact copy of the source directory in the destination directory. However, it can accidentally delete important files if not used carefully. Pairing -delete with --dry-run and -i flags lets rsync simulate the deletion process without actually removing any files, providing a detailed report of what would be deleted.\n\nThe sort command initially misled me when it claimed a 1.1GB file was the smallest in a folder. The -a flag in sort helps in sorting files in a human-readable format, making it easier to understand the sizes and other details.\n\nWhen using rsync for system backups, a dry run with the --dry-run flag helps identify which files would be included or excluded. For example, excluding /proc, /sys, and /dev directories using the -x flag reduces the number of entries in the backup. The --no-whole-file option ensures that partial transfers are picked up correctly, saving time during resumptions.\n\nThe find command, when used with -prune, skips specific directories completely, while -exec and -fprint execute commands on each file found. This can significantly speed up processes like counting files, as demonstrated by the speed difference between using -exec and + in find.\n\nThe -newer flag helps identify files that have been modified since a specific date or marker file. This is useful for backup and synchronization tasks. However, interpreting the output of du -sh in conjunction with sort -n can be tricky, as plain sorting compares text rather than numerical values. The -h flag in sort resolves this issue by interpreting sizes in a human-readable format, making the output more intuitive.",
  "summary": "I've been Linux'ing in hard mode",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}