sync command in Linux is used to synchronize cached writes to persistent storage. If one or more files are specified, sync only them, or their containing file systems.
Syntax:
sync [OPTION] [FILE]...
Note: Nothing is being shown in the screenshots just because sync command makes the cache in the background.
Example: It will be going to sync all cached file data that belongs to the current user.

Options:
- sync -d: This option sync only file data, no unneeded metadata.
Example:
sync -d /home/algoscale/Desktop/aricleslist.txt /home/algoscale/Desktop/advance.html

- sync -f: This option will sync the file systems which contains the files.
Example:
sync -f /home/algoscale/Desktop/aricleslist.txt

- sync –help: This option display the help text and exit.
sync --help

- sync –version: This option will output version information and exit.
sync --version

Learn to code easily with our course
Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated :
18 Jan, 2022
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...