# phpman > man > sync(1)

> **TLDR:** Flushes all pending write operations to the appropriate disks.
>
- Flush all pending write operations on all disks:
  `sync`
- 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`

*Source: tldr-pages*

---

[SYNC(1)](https://www.chedong.com/phpMan.php/man/SYNC/1/markdown)                                     User Commands                                    [SYNC(1)](https://www.chedong.com/phpMan.php/man/SYNC/1/markdown)



## NAME
       sync - Synchronize cached writes to persistent storage

## SYNOPSIS
       **sync** [_OPTION_] [_FILE_]...

## DESCRIPTION
       Synchronize cached writes to persistent storage

       If one or more files are specified, sync only them, or their containing file systems.

### -d --data
              sync only file data, no unneeded metadata

### -f --file-system
              sync the file systems that contain the files

       **--help** display this help and exit

### --version
              output version information and exit

## BUGS
       Persistence guarantees vary per system.  See the system calls below for more details.

## AUTHOR
       Written by Jim Meyering and Giuseppe Scrivano.

## REPORTING BUGS
       GNU coreutils online help: <<https://www.gnu.org/software/coreutils/>>
       Report any translation bugs to <<https://translationproject.org/team/>>

## COPYRIGHT
       Copyright  ©  2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later
       <<https://gnu.org/licenses/gpl.html>>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to
       the extent permitted by law.

## SEE ALSO
       [fdatasync(2)](https://www.chedong.com/phpMan.php/man/fdatasync/2/markdown), [fsync(2)](https://www.chedong.com/phpMan.php/man/fsync/2/markdown), [sync(2)](https://www.chedong.com/phpMan.php/man/sync/2/markdown), [syncfs(2)](https://www.chedong.com/phpMan.php/man/syncfs/2/markdown)

       Full documentation <<https://www.gnu.org/software/coreutils/sync>>
       or available locally via: info '(coreutils) sync invocation'



GNU coreutils 8.32                          January 2026                                     [SYNC(1)](https://www.chedong.com/phpMan.php/man/SYNC/1/markdown)
