sync
Write pending cached data to disk (synchronize), blocking until done. toybox
On Linux, macOS
Linux
sync
Linux
Flush all pending write operations to the appropriate disks.
Flush all pending write operations on all disks
syncIdentifyFlush all pending write operations on a single file to disk
sync path/to/fileIdentifyFlush writes and drop filesystem caches
sync; echo 3 | sudo tee /proc/sys/vm/drop_cachesIdentifymacOS
Flush all pending write operations to the appropriate disks.
Flush all pending write operations on all disks
syncIdentifyFlush all pending write operations on a single file to disk
sync path/to/fileIdentifyFlush disk writes and attempt to clear inactive memory and filesystem caches
sync; sudo purgeIdentify