{
    "mode": "man",
    "parameter": "SYNC",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/SYNC/1/json",
    "generated": "2026-06-15T14:39:14Z",
    "synopsis": "sync [OPTION] [FILE]...",
    "sections": {
        "NAME": {
            "content": "sync - Synchronize cached writes to persistent storage\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sync [OPTION] [FILE]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Synchronize cached writes to persistent storage\n\nIf one or more files are specified, sync only them, or their containing file systems.\n",
            "subsections": [
                {
                    "name": "-d --data",
                    "content": "sync only file data, no unneeded metadata\n",
                    "flag": "-d",
                    "long": "--data"
                },
                {
                    "name": "-f --file-system",
                    "content": "sync the file systems that contain the files\n\n--help display this help and exit\n",
                    "flag": "-f",
                    "long": "--file-system"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "BUGS": {
            "content": "Persistence guarantees vary per system.  See the system calls below for more details.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Written by Jim Meyering and Giuseppe Scrivano.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later\n<https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fdatasync(2), fsync(2), sync(2), syncfs(2)\n\nFull documentation <https://www.gnu.org/software/coreutils/sync>\nor available locally via: info '(coreutils) sync invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                     SYNC(1)",
            "subsections": []
        }
    },
    "summary": "sync - Synchronize cached writes to persistent storage",
    "flags": [
        {
            "flag": "-d",
            "long": "--data",
            "arg": null,
            "description": "sync only file data, no unneeded metadata"
        },
        {
            "flag": "-f",
            "long": "--file-system",
            "arg": null,
            "description": "sync the file systems that contain the files --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "fdatasync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fdatasync/2/json"
        },
        {
            "name": "fsync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fsync/2/json"
        },
        {
            "name": "sync",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/sync/2/json"
        },
        {
            "name": "syncfs",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/syncfs/2/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Flushes all pending write operations to the appropriate disks.",
        "examples": [
            {
                "description": "Flush all pending write operations on all disks",
                "command": "sync"
            },
            {
                "description": "Flush all pending write operations on a single file to disk",
                "command": "sync {{path/to/file}}"
            },
            {
                "description": "Flush writes and drop filesystem caches (Linux only)",
                "command": "sync; echo 3 | sudo tee /proc/sys/vm/drop_caches"
            },
            {
                "description": "Flush disk writes and attempts to clear inactive memory and filesystem caches (macOS only)",
                "command": "sync; sudo purge"
            }
        ]
    }
}