{
    "content": [
        {
            "type": "text",
            "text": "# SYNC (man)\n\n## NAME\n\nsync - Synchronize cached writes to persistent storage\n\n## SYNOPSIS\n\nsync [OPTION] [FILE]...\n\n## DESCRIPTION\n\nSynchronize cached writes to persistent storage\n\n## TLDR\n\n> Flushes all pending write operations to the appropriate disks.\n\n- Flush all pending write operations on all disks:\n  `sync`\n- Flush all pending write operations on a single file to disk:\n  `sync {{path/to/file}}`\n- Flush writes and drop filesystem caches (Linux only):\n  `sync; echo 3 | sudo tee /proc/sys/vm/drop_caches`\n- Flush disk writes and attempts to clear inactive memory and filesystem caches (macOS only):\n  `sync; sudo purge`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (3 subsections)\n- **BUGS**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SYNC",
        "section": "",
        "mode": "man",
        "summary": "sync - Synchronize cached writes to persistent storage",
        "synopsis": "sync [OPTION] [FILE]...",
        "tldr_summary": "Flushes all pending write operations to the appropriate disks.",
        "tldr_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"
            }
        ],
        "tldr_source": "official",
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "-d --data",
                        "lines": 2,
                        "flag": "-d",
                        "long": "--data"
                    },
                    {
                        "name": "-f --file-system",
                        "lines": 4,
                        "flag": "-f",
                        "long": "--file-system"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            }
        ],
        "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": []
            }
        }
    }
}