Flush All Pending Disk Writes with sync
Make sure cached writes physically land on disk before unplugging a drive or killing power.
01Command
$ sync02What it does
Linux caches writes in memory for speed, so 'the copy finished' in the file manager does not mean the data is on the platter or flash chip yet. sync asks the kernel to flush dirty pages and buffers for all filesystems, or just one when you pass a file or mount point (GNU coreutils extension). It returns only after the kernel reports the data is on persistent storage, which is why a large USB copy can appear stuck for a while after the progress bar ends.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- sync(1) — Linux man pageEvidence: Man page states sync 'synchronize cached writes to persistent storage' and documents -f/--data and -d options; confirms 'sync' and 'flush' semantics in the text.
- sync(1) — Debian man page (coreutils)Evidence: Man page describes flushing file system buffers: 'force changed blocks to disk, update the super block', confirming the flush behavior.
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
autoremove deletes no-longer-needed dependency packages, and clean wipes the downloaded .deb cache in /var/cache/apt/archives.
ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.
Check how much space the binary journal consumes and permanently trim it by size, age, or file count.