coreutils: sync invocation

1 
1 14.4 ‘sync’: Synchronize cached writes to persistent storage
1 ============================================================
1 
1 ‘sync’ synchronizes in memory files or file systems to persistent
1 storage.  Synopsis:
1 
1      sync [OPTION] [FILE]...
1 
1    ‘sync’ writes any data buffered in memory out to disk.  This can
1 include (but is not limited to) modified superblocks, modified inodes,
1 and delayed reads and writes.  This must be implemented by the kernel;
1 The ‘sync’ program does nothing but exercise the ‘sync’, ‘syncfs’,
1 ‘fsync’, and ‘fdatasync’ system calls.
1 
1    The kernel keeps data in memory to avoid doing (relatively slow) disk
1 reads and writes.  This improves performance, but if the computer
1 crashes, data may be lost or the file system corrupted as a result.  The
1 ‘sync’ command instructs the kernel to write data in memory to
1 persistent storage.
1 
1    If any argument is specified then only those files will be
1 synchronized using the fsync(2) syscall by default.
1 
1    If at least one file is specified, it is possible to change the
11 synchronization method with the following options.  Also see ⇒
 Common options.
1 
1 ‘-d’
1 ‘--data’
1      Use fdatasync(2) to sync only the data for the file, and any
1      metadata required to maintain file system consistency.
1 
1 ‘-f’
1 ‘--file-system’
1      Synchronize all the I/O waiting for the file systems that contain
1      the file, using the syscall syncfs(2).  Note you would usually
1      _not_ specify this option if passing a device node like ‘/dev/sda’
1      for example, as that would sync the containing file system rather
1      than the referenced one.  Note also that depending on the system,
1      passing individual device nodes or files may have different sync
1      characteristics than using no arguments.  I.e., arguments passed to
1      fsync(2) may provide greater guarantees through write barriers,
1      than a global sync(2) used when no arguments are provided.
1 
1    An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1