2017-09-28 10:30:26 +01:00
|
|
|
# sync
|
|
|
|
|
2017-09-28 22:13:38 +01:00
|
|
|
> Flushes all pending write operations to the appropriate disks.
|
2025-01-18 18:45:33 +05:30
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/sync-invocation.html>.
|
2017-09-28 10:30:26 +01:00
|
|
|
|
2017-09-28 22:13:38 +01:00
|
|
|
- Flush all pending write operations on all disks:
|
2017-09-28 10:30:26 +01:00
|
|
|
|
|
|
|
`sync`
|
|
|
|
|
2017-09-28 22:13:38 +01:00
|
|
|
- Flush all pending write operations on a single file to disk:
|
2017-09-28 10:30:26 +01:00
|
|
|
|
2017-09-28 22:13:38 +01:00
|
|
|
`sync {{path/to/file}}`
|
2025-06-12 11:31:20 +10:00
|
|
|
|
|
|
|
- Flush writes and drop file system 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`
|