SYNC(8)
π NAME π
okay so welcome to SYNC(8) from the System Manager's Manual, bestie β this is the lil page for the sync utility. The name section is literally:
syncβ force completion of pending disk writes (flush cache)
no cap, that's the whole vibe: it makes pending disk writes finish and flushes the cache. β¨
β¨ SYNOPSIS β¨
sync
that's it. one word, main character energy, periodt. π
πΈ DESCRIPTION πΈ
Okay so you can call the sync utility to ensure that all disk writes have been completed before the processor is halted in a way that isn't suitably done by reboot(8) or halt(8). Basically it's the βmake sure the writes actually landedβ girlie. π«Ά
Generally, it's preferable to use reboot(8) or halt(8) to shut down the system, because they may perform additional actions such as resynchronizing the hardware clock and flushing internal caches before performing a final sync. So like, let the shutdown besties do their extra steps, iykyk. π
Under the hood, the sync utility utilizes the sync(2) function call. That's the whole tea. π
π¦ SEE ALSO π¦
go read these if you want the full lore. slay. π
π HISTORY π
A sync utility appeared in Version 4 AT&T UNIX. So like, she's been iconic since forever. π
On systems older than 4.0BSD, commands like reboot(8) and halt(8) were unavailable. The shutdown procedure involved running sync, waiting for the lights to stop, and turning off the machine. Literally: run sync, stare at the lights, then power down. π
Issuing three separate sync commands (one line each) was a placebo that would generally suffice in Version 7 AT&T UNIX machines that were otherwise quiesced systems. It replaced the one-per-line sync as a substitute for waiting.
4.0BSD introducedreboot(2)andsync(2)which rendered this trick obsolete. so the three-sync placebo era was over, periodt. π
later, bestie! this page is from Debian, dated April 25, 2024, and it's the SYNC(8) manual page. slay, and may your pending disk writes be ever completed. π π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms