When you’re working in an embedded Linux environment, liberal use of the
sync command can be a headache saver. Here’s the thing: in most embedded systems, your OS will be running from something like an SD card or flash and you may be subject to unexpected power loss. When you’re editing files or making changes in the filesystem, some of these edits and/or changes are only written to buffer cache, not the flash disk (not yet anyways).
sync will force the system to commit the buffer cache to the disk.
As always, be sure to check out the man page for more information.