{
    "content": [
        {
            "type": "text",
            "text": "# sync (info)\n\n## Sections\n\n- **File: coreutils.info,  Node: sync invocation,  Next: truncate invocation,  Prev: stat invocation,  Up: Disk usage** (1 subsections)\n- **The 'sync' program does nothing but exercise the 'sync', 'syncfs',**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "sync",
        "section": "",
        "mode": "info",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "File: coreutils.info,  Node: sync invocation,  Next: truncate invocation,  Prev: stat invocation,  Up: Disk usage",
                "lines": 1,
                "subsections": [
                    {
                        "name": "14.4 'sync': Synchronize cached writes to persistent storage",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "The 'sync' program does nothing but exercise the 'sync', 'syncfs',",
                "lines": 35,
                "subsections": []
            }
        ],
        "sections": {
            "File: coreutils.info,  Node: sync invocation,  Next: truncate invocation,  Prev: stat invocation,  Up: Disk usage": {
                "content": "",
                "subsections": [
                    {
                        "name": "14.4 'sync': Synchronize cached writes to persistent storage",
                        "content": "'sync' synchronizes in memory files or file systems to persistent\nstorage.  Synopsis:\n\nsync [OPTION] [FILE]...\n\n'sync' writes any data buffered in memory out to disk.  This can\ninclude (but is not limited to) modified superblocks, modified inodes,\nand delayed reads and writes.  This must be implemented by the kernel;"
                    }
                ]
            },
            "The 'sync' program does nothing but exercise the 'sync', 'syncfs',": {
                "content": "'fsync', and 'fdatasync' system calls.\n\nThe kernel keeps data in memory to avoid doing (relatively slow) disk\nreads and writes.  This improves performance, but if the computer\ncrashes, data may be lost or the file system corrupted as a result.  The\n'sync' command instructs the kernel to write data in memory to\npersistent storage.\n\nIf any argument is specified then only those files will be\nsynchronized using the fsync(2) syscall by default.\n\nIf at least one file is specified, it is possible to change the\nsynchronization method with the following options.  Also see *note\nCommon options::.\n\n'-d'\n'--data'\nUse fdatasync(2) to sync only the data for the file, and any\nmetadata required to maintain file system consistency.\n\n'-f'\n'--file-system'\nSynchronize all the I/O waiting for the file systems that contain\nthe file, using the syscall syncfs(2).  Note you would usually\nnot specify this option if passing a device node like '/dev/sda'\nfor example, as that would sync the containing file system rather\nthan the referenced one.  Note also that depending on the system,\npassing individual device nodes or files may have different sync\ncharacteristics than using no arguments.  I.e., arguments passed to\nfsync(2) may provide greater guarantees through write barriers,\nthan a global sync(2) used when no arguments are provided.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n",
                "subsections": []
            }
        }
    }
}