commands.sh

sync

all

Flushes all pending write operations to the appropriate disks.

More info →

Examples (4)

Flush all pending write operations on all disks

Flush all pending write operations on a single file to disk

sync path/to/file

Flush writes and drop filesystem caches (Linux only)

sync; echo 3 | sudo tee /proc/sys/vm/drop_caches

Flush disk writes and attempts to clear inactive memory and filesystem caches (macOS only)

sync; sudo purge
made by @shridhargupta | data from tldr-pages