sync command in Linux with Examples
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/addvance.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
Recommended Posts:
- rev command in Linux with Examples
- pwd command in Linux with Examples
- more command in Linux with Examples
- last command in Linux with Examples
- gdb command in Linux with examples
- cc command in Linux with Examples
- apt-get command in Linux with Examples
- df command in Linux with Examples
- du command in Linux with examples
- until command in Linux with Examples
- arp command in Linux with examples
- gcc command in Linux with examples
- cut command in Linux with examples
- fmt command in Linux with examples
- ssh command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.








