{"id":5258,"date":"2023-02-05T04:20:14","date_gmt":"2023-02-05T04:20:14","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=5258"},"modified":"2024-01-10T05:50:24","modified_gmt":"2024-01-10T05:50:24","slug":"sync-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/sync-command-in-linux\/","title":{"rendered":"The \u201csync\u201d Command in Linux [8 Practical Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\">The <strong>sync<\/strong> command in <strong>Linux<\/strong> is used to <strong>synchronize <\/strong>the system\u2019s data. It writes the cache files to permanent storage. Due to the faster speed of <strong>RAM<\/strong>, the system uses this temporary storage to process data rather than using permanent storage. And <strong>Kernel <\/strong>stores those data in <strong>RAM<\/strong> as cache files. Even though this action enhances the speed of the system, any kind of sudden crash could result in losing important cache data. So synchronizing data on the permanent memory is safe bait. In this article, I will talk about the <strong>sync <\/strong>command and its usage with some practical examples.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#A_Description\" >A. Description<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#B_Syntax\" >B. Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#C_Options\" >C. Options<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Practical_Examples_of_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Practical Examples of the \u201csync\u201d Command in Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_1_Sync_All_User_Cache_Files_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 1: Sync All User Cache Files Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_2_Sync_Specific_File_Systems_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 2: Sync Specific File Systems Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_3_Sync_Only_File_Data_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 3: Sync Only File Data Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_4_Sync_a_Filesystem_Containing_files_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 4: Sync a Filesystem Containing files Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_5_Sync_a_Directory_and_Sub-Directory_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 5: Sync a Directory and Sub-Directory Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_6_Sync_Mounted_Partitions_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\" >Example 6: Sync Mounted Partitions Using the \u201csync\u201d Command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_7_Check_the_%E2%80%9Csync%E2%80%9D_Command_Version_on_Your_System\" >Example 7: Check the \u201csync\u201d Command Version on Your System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Example_8_Print_the_Help_messages_for_the_%E2%80%9Csync%E2%80%9D_Command\" >Example 8: Print the Help messages for the \u201csync\u201d Command<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"A_Description\"><\/span>A. Description<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>sync<\/strong> command allows putting your data in sync both in permanent storage &amp; volatile memory. It makes sure all buffered modifications made to file metadata and data are written to the underlying file systems. Every <strong>Linux <\/strong>user should use the <strong>sync<\/strong> command before halting the processor in an unusual manner to save all the cache data. Also, remember the <strong>sync<\/strong> command is only assured to schedule messy blocks for writing, it can take a short time before all the blocks are finally written.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"B_Syntax\"><\/span>B. Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <strong>sync<\/strong> command is a simple tool but has an important role in protecting your buffered data. The syntax of this command is straightforward. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync [option]... [file]...<\/code><\/pre>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>Note: <\/strong>Whatever is enclosed by a square bracket in the above <strong>syntax<\/strong> is not mandatory. Moreover, the <strong>option <\/strong>&amp; <strong>file <\/strong>both are enclosed by <strong>square brackets<\/strong> and followed by <strong>3 dots<\/strong> representing that multiple <strong>options &amp; files <\/strong>can be used &amp; synchronized at a time.<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"C_Options\"><\/span>C. Options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>sync<\/strong> command in <strong>Linux <\/strong>is one of the flexible tools to manage your data. It has some <strong>options<\/strong> which you can use to customize the synchronization process. I will give a list of them with a short list here. You can view a lot more information about the command from the <strong>man<\/strong> page.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">man sync<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>Useful Options<\/strong><\/span><\/p>\n<div class=\"su-list\" style=\"margin-left:20px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-d, &#8211;data, <\/strong>to sync only the data of the filesystem, and essential metadata.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>-f, &#8211;file-system, <\/strong>to sync the filesystem containing the specified files.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>&#8211;version, <\/strong>to check the version of the command and then exit.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> <strong>&#8211;help, <\/strong>to display the help messages for the command and then exit.<\/li>\n<\/ul>\n<\/div>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>NOTE:<\/strong> The <strong>options<\/strong> in<strong> Linux<\/strong> <a href=\"https:\/\/linuxsimply.com\/cli-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>CLI (Command Line Interface)<\/strong><\/a> are all <strong>case-sensitive<\/strong>, So be cautious while using them.<\/p>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Examples_of_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Practical Examples of the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <strong>sync<\/strong> command while used ensures that all the cached files of your system are written on the permanent storage. Make sure to run the command beforehand when there is a need for an unusual shutdown of your system. I will give some practical examples of the <strong>sync <\/strong>command in the following article, so keep reading.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_1_Sync_All_User_Cache_Files_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 1: Sync All User Cache Files Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>sync<\/strong> command when used without any <strong>arguments<\/strong>, by default, synchronizes and writes all the <strong>cache files<\/strong> of the current user to the disk. You can use the <strong>sudo <\/strong>command while running the command to include the synchronization of all the mounted files too. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>OR,<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo sync<\/code><\/pre>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>Note: <\/strong>Only a <strong>superuser<\/strong> can sync filesystems inside the root. So to run the command for all filesystems use <strong>\u2018sudo\u2019<\/strong> ( <strong>S<\/strong>ubstitute <strong>U<\/strong>ser <strong>DO<\/strong>) before the command. Temporarily it allows you to appoint your current user to have<strong> root privileges<\/strong>.<\/p>\n<\/div><\/div>\n<p>Check the below steps to sync all the data in your system.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a At first open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following commands in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync<\/code><\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">sudo sync<\/code><\/pre>\n<p>\u278c Give your <strong>password<\/strong>.<\/p>\n<p>\u278d Now, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">Check the below picture, your output display will look like it. If you notice you can\u2019t see anything on your output, it\u2019s because the <strong>sync <\/strong>command works in the background. And it can take a little time to write all the cached files. <img decoding=\"async\" class=\"aligncenter size-full wp-image-5260\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-1.png\" alt=\"sync command in linux.\" width=\"359\" height=\"105\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-1.png 359w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-1-300x88.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-1-766x224.png 766w\" sizes=\"(max-width: 359px) 100vw, 359px\" \/>And when you run the command with sudo to run all the files including the mounted files, the output will look like the following picture,<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-5261\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-2.png\" alt=\"sync command in linux to sync files of root directory.\" width=\"455\" height=\"118\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-2.png 455w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-2-300x78.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-2-767x199.png 767w\" sizes=\"(max-width: 455px) 100vw, 455px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/time-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ctime\u201d Command in Linux [4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/tty-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201ctty\u201d Command in Linux [4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/uptime-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cuptime\u201d Command in Linux [5 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/vmstat-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cvmstat\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/uname-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cuname\u201d Command in Linux [11 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/apt-get-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201capt-get\u201d Command in Linux [10 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_Sync_Specific_File_Systems_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 2: Sync Specific File Systems Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can specify the file systems you want to sync. Sync one or multiple <strong>specific file systems <\/strong>using the <strong>sync<\/strong> command. To do so, just type the command and then give the <strong>file name<\/strong> you want to sync with their <strong>location<\/strong>. If you want to sync multiple files then give the names of multiple files and their associated locations. You can also sync multiple files at a time that are stored in different places. Just specify the right location of each file. The\u00a0 syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync &lt;\/location\/file_name_1&gt; &lt;\/location\/file_name_2&gt;...<\/code><\/pre>\n<p style=\"text-align: justify;\">Read the below steps to sync some of your specific files practically. I will sync my two files named<strong> story<\/strong> and <strong>WeddingList<\/strong> which are stored in the same location, Desktop. And two other files <strong>A1 <\/strong>&amp; <strong>B1<\/strong>, are stored in different locations.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Begin by opening the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt to sync files from the same location:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync \/home\/munny\/Desktop\/story \/home\/munny\/Desktop\/WeddingList<\/code><\/pre>\n<p>\u278c Now, press the <strong>ENTER<\/strong> key.<\/p>\n<p>\u278d After that, type the following command in the command prompt to sync files from different locations:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync A1 \/home\/munny\/Desktop\/B1<\/code><\/pre>\n<p>\u278e Finally, press the <strong>ENTER <\/strong>button.<\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p><strong>Note: <\/strong>Make sure to use the right <strong>location<\/strong> of your filesystems to run the command successfully.<\/p>\n<\/div><\/div>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>After running the first command the output display will look like the following image.<img decoding=\"async\" class=\"aligncenter size-full wp-image-5262\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-3.png\" alt=\"Sync a specific file using sync command in linux.\" width=\"825\" height=\"63\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-3.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-3-300x23.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-3-760x58.png 760w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> And, after running the second command the output display will look like the following image.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5263\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-4.png\" alt=\"Sync files from diffrent location using sync command in linux.\" width=\"625\" height=\"80\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-4.png 625w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-4-300x38.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-4-766x98.png 766w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_Sync_Only_File_Data_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 3: Sync Only File Data Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can sync only the <strong>file data <\/strong>with the minimum metadata necessary for filesystem consistency while synchronizing them. To do that, use the <strong>sync<\/strong> command with the<strong> option &#8211;data<\/strong> or <strong>-d<\/strong> followed by the filenames you want to sync with their location. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync -d &lt;\/location\/file_name_1&gt; &lt;\/location\/file_name_2&gt;...<\/code><\/pre>\n<p>Proceed to carry out the following steps to sync only the file data practically.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Start by opening your <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync -d \/home\/munny\/Desktop\/File1 \/home\/munny\/Desktop\/File2<\/code><\/pre>\n<p>\u278c Now, hit the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>The command will sync only the file data of the files<strong> File1<\/strong> &amp; <strong>File2<\/strong>, like in the below picture.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5264\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-5.png\" alt=\"Sync only file data using sync command in linux.\" width=\"825\" height=\"83\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-5.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-5-300x30.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-5-765x77.png 765w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/free-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cfree\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/getent-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgetent\u201d Command in Linux [11 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/groupadd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgroupadd\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/addgroup-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201caddgroup\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/groups-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgroups\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/firewall-cmd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cfirewall-cmd\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_4_Sync_a_Filesystem_Containing_files_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 4: Sync a Filesystem Containing files Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">So far you learned how to sync a specific filename. Now if you want to sync the entire <strong>filesystem<\/strong> and all the containing files with the <strong>sync <\/strong>command then use the <strong>option &#8211;filesystem<\/strong> or <strong>-f <\/strong>after the command. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync -f &lt;file_system_name&gt;<\/code><\/pre>\n<p style=\"text-align: justify;\">Go through the below steps to sync one of your file systems. I will sync my filesystem <strong>Yearly_Routine<\/strong> and it&#8217;s <strong>15<\/strong> containing files.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Launch the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Then type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync -f Yearly_Routine<\/code><\/pre>\n<p>\u278c Finally, tap the <strong>ENTER<\/strong> key.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>The output image will look like the below picture.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5265\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-6.png\" alt=\"Sync an entire filesystem using sync command in linux.\" width=\"530\" height=\"78\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-6.png 530w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-6-300x44.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-6-768x113.png 768w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_5_Sync_a_Directory_and_Sub-Directory_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 5: Sync a Directory and Sub-Directory Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can sync any <strong>directory <\/strong>and also any <strong>subdirectory <\/strong>inside of a directory. Just specify the name of that directory or subdirectory with their location on your system with the<strong> sync <\/strong>command. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync &lt;\/location\/directory&gt;\u00a0<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>OR,<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync &lt;location\/directory\/sub-directory&gt;<\/code><\/pre>\n<p>Follow the below steps to see practically.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Launch your<strong> Terminal <\/strong>application on your<strong> Ubuntu.<\/strong><\/p>\n<p>\u278b Type the following command in the command prompt to sync a <strong>directory<\/strong>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync \/home\/munny\/Directory<\/code><\/pre>\n<p>\u278c Tap the <strong>ENTER<\/strong> button.<\/p>\n<p>\u278d Then, type the following command in the command prompt to sync a system <strong>subdirectory<\/strong>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo sync \/var\/log\/lastlog<\/code><\/pre>\n<p>\u278e Finally, Tab the <strong>ENTER<\/strong> button again.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>I ran the first command to sync my <strong>Directory <\/strong>and got the below output display.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5266 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-7.png\" alt=\"Sync directory.\" width=\"512\" height=\"85\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-7.png 512w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-7-300x50.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-7-765x127.png 765w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/> Then I ran the second command to sync my system <strong>subdirectory log<\/strong> and the output looked like the below image.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5267 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-8.png\" alt=\"Sync sub-directory.\" width=\"704\" height=\"80\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-8.png 704w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-8-300x34.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-8-766x87.png 766w\" sizes=\"(max-width: 704px) 100vw, 704px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/groupmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cgroupmod\u201d Command in Linux [5+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/id-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cid\u201d Command in Linux [7+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/service-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cservice\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/sestatus-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201csestatus\u201d Command in Linux [4 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/shutdown-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cshutdown\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/finger-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cfinger\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_6_Sync_Mounted_Partitions_Using_the_%E2%80%9Csync%E2%80%9D_Command_in_Linux\"><\/span>Example 6: Sync Mounted Partitions Using the \u201csync\u201d Command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Use the<strong> sync <\/strong>command to sync any particular <strong>mounted <\/strong>file. Just give the <strong>mounted<\/strong> file location after the <strong>sync<\/strong> command. Also, remember to use the <strong>sudo<\/strong> command before the <strong>sync<\/strong> command, as the mounted files are stored inside the<strong> root<\/strong> directory. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo sync &lt;\/location\/mounted_partition&gt;<\/code><\/pre>\n<p>Follow the below steps to sync any mounted filesystem.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Begin by opening your <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b First, type the following command in the command prompt to check all the mounted files on your system:\u2019<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">df -h<\/code><\/pre>\n<p>\u278c Press the <strong>ENTER<\/strong> button.<\/p>\n<p>\u278d Then type the following command in the command prompt to sync the<strong> sda3 <\/strong>mounted file from the list,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo sync \/dev\/sda3<\/code><\/pre>\n<p>\u278e Give your <strong>password. <\/strong><\/p>\n<p>\u278f Finally, tap the <strong>ENTER<\/strong> key.<\/p>\n<div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<p style=\"text-align: justify;\"><strong>Note:<\/strong> The <strong>df<\/strong> (Disk Free) command in <strong>Linux<\/strong> is used to display the files&#8217; information by checking the used space and free space by the files. You can run this command to check your mounted files and their information.<\/p>\n<\/div><\/div>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>After running the first command, you will see the list of all the mounted files on your system. From the list of my mounted file, I will sync the<strong> sda3<\/strong> file.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5268\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-9.png\" alt=\"df command to view mounted file list.\" width=\"825\" height=\"213\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-9.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-9-300x77.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-9-767x198.png 767w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> After that, run the second command to sync the selected mounted file. I ran the command to sync my mounted file <strong>sda3 <\/strong>and the output looked like the following image.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5269 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-10.png\" alt=\"Sync mounted files.\" width=\"583\" height=\"121\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-10.png 583w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-10-300x62.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-10-766x159.png 766w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_7_Check_the_%E2%80%9Csync%E2%80%9D_Command_Version_on_Your_System\"><\/span>Example 7: Check the \u201csync\u201d Command Version on Your System<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Check the<strong> version <\/strong>of the <strong>sync<\/strong> command tool on your system using the <strong>option &#8211;version <\/strong>or <strong>-v <\/strong>of your command. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync --version<\/code><\/pre>\n<p>Read the below steps to see the command version on your system.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a Run the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync --version<\/code><\/pre>\n<p>\u278c Now, push the <strong>ENTER<\/strong> button on your keyboard.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>The output display will show the<strong> version<\/strong>, <strong>copyrigh<\/strong>t, and \u201c<strong>license<\/strong> of the <strong>sync<\/strong> command.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5270\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-11.png\" alt=\"Print sync command version.\" width=\"825\" height=\"180\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-11.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-11-300x65.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-11-765x167.png 765w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/dmesg-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cdmesg\u201d Command in Linux [7+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/install-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cinstall\u201d Command in Linux [6+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/reboot-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201creboot\u201d Command in Linux [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/sudo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201csudo\u201d Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/chage-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cchage\u201d Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/env-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cenv \u201d Command in Linux [9 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Example_8_Print_the_Help_messages_for_the_%E2%80%9Csync%E2%80%9D_Command\"><\/span>Example 8: Print the Help messages for the \u201csync\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>While working with the <strong>sync<\/strong> command, if you need any <strong>help <\/strong>with the<strong> options <\/strong>and usage of the command use the <strong>&#8211;help option<\/strong>. It will concisely display all the details about the command <strong>options<\/strong> and then <strong>exit<\/strong>. The syntax is,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync --help<\/code><\/pre>\n<p>See the below steps to learn how to print <strong>help <\/strong>messages.<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<br \/>\n<\/strong><\/span><\/p>\n<p>\u278a First, open the <strong>Ubuntu Terminal<\/strong>.<\/p>\n<p>\u278b Then, type the following command in the command prompt:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sync --help<\/code><\/pre>\n<p>\u278c Finally, press the <strong>ENTER<\/strong> button.<\/p>\n<p><span style=\"color: #0000ff;\"><strong><span style=\"color: #800080;\">Output &gt;<\/span> <\/strong><\/span><\/p>\n<p>The output will display the following <strong>help messages<\/strong> for the command.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5271\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-12.png\" alt=\"Display help messages of sync command in linux.\" width=\"700\" height=\"324\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-12.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-12-300x139.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux-12-767x355.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this article, I discussed the <strong>sync <\/strong>command and how it can be used to synchronize your system\u2019s buffered files with some practical examples. After completing the article, I hope you will learn most of the stuff related to the command <strong>tool<\/strong> and be a power user of <strong>LINUX<\/strong>.<\/p>\n<hr \/>\n<p><strong><span style=\"font-size: 18pt; color: #000080;\">Similar Readings<\/span><\/strong><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/passwd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The &#8220;passwd&#8221; Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/df-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cdf\u201d Command in Linux [11 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/apt-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201capt\u201d Command in Linux [13+ Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/top-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The &#8220;top&#8221; Command in Linux [8 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/htop-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The &#8220;htop&#8221; Command in Linux [7 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/enable-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">The \u201cenable\u201d Command in Linux [6 Practical Examples]<\/a><\/strong><\/li>\n<\/ul>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;5258&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;The \u201csync\u201d Command in Linux [8 Practical Examples]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>The sync command in Linux is used to synchronize the system\u2019s data. It writes the cache files to permanent storage. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"The \u201csync\u201d Command in Linux [8 Practical Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/#more-5258\" aria-label=\"Read more about The \u201csync\u201d Command in Linux [8 Practical Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314897,"featured_media":5272,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[51],"class_list":["post-5258","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands","tag-system-commands","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The \u201csync\u201d Command in Linux [8 Practical Examples]<\/title>\n<meta name=\"description\" content=\"The sync command in Linux is an essential command tool to synchronize all user cache files on the system&#039;s permanent storage.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The \u201csync\u201d Command in Linux [8 Practical Examples]\" \/>\n<meta property=\"og:description\" content=\"The sync command in Linux is an essential command tool to synchronize all user cache files on the system&#039;s permanent storage.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/sync-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/moniramunny05\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-05T04:20:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-10T05:50:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Monira Akter Munny\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monira Akter Munny\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/\"},\"author\":{\"name\":\"Monira Akter Munny\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\"},\"headline\":\"The \u201csync\u201d Command in Linux [8 Practical Examples]\",\"datePublished\":\"2023-02-05T04:20:14+00:00\",\"dateModified\":\"2024-01-10T05:50:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/\"},\"wordCount\":1995,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/sync-command-in-linux.png\",\"keywords\":[\"system commands\"],\"articleSection\":[\"Linux Commands\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/\",\"name\":\"The \u201csync\u201d Command in Linux [8 Practical Examples]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/sync-command-in-linux.png\",\"datePublished\":\"2023-02-05T04:20:14+00:00\",\"dateModified\":\"2024-01-10T05:50:24+00:00\",\"description\":\"The sync command in Linux is an essential command tool to synchronize all user cache files on the system's permanent storage.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/sync-command-in-linux.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/sync-command-in-linux.png\",\"width\":400,\"height\":400,\"caption\":\"sync command in linux.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/sync-command-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The \u201csync\u201d Command in Linux [8 Practical Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\",\"name\":\"Monira Akter Munny\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"caption\":\"Monira Akter Munny\"},\"description\":\"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/moniramunny05\",\"https:\\\/\\\/www.instagram.com\\\/monira_munny\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/monira-akter-munny-a76742113\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/munny\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The \u201csync\u201d Command in Linux [8 Practical Examples]","description":"The sync command in Linux is an essential command tool to synchronize all user cache files on the system's permanent storage.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/sync-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"The \u201csync\u201d Command in Linux [8 Practical Examples]","og_description":"The sync command in Linux is an essential command tool to synchronize all user cache files on the system's permanent storage.","og_url":"https:\/\/linuxsimply.com\/sync-command-in-linux\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/moniramunny05","article_published_time":"2023-02-05T04:20:14+00:00","article_modified_time":"2024-01-10T05:50:24+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png","type":"image\/png"}],"author":"Monira Akter Munny","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monira Akter Munny","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/"},"author":{"name":"Monira Akter Munny","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e"},"headline":"The \u201csync\u201d Command in Linux [8 Practical Examples]","datePublished":"2023-02-05T04:20:14+00:00","dateModified":"2024-01-10T05:50:24+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/"},"wordCount":1995,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png","keywords":["system commands"],"articleSection":["Linux Commands"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/sync-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/","url":"https:\/\/linuxsimply.com\/sync-command-in-linux\/","name":"The \u201csync\u201d Command in Linux [8 Practical Examples]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png","datePublished":"2023-02-05T04:20:14+00:00","dateModified":"2024-01-10T05:50:24+00:00","description":"The sync command in Linux is an essential command tool to synchronize all user cache files on the system's permanent storage.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/sync-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/02\/sync-command-in-linux.png","width":400,"height":400,"caption":"sync command in linux."},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/sync-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"The \u201csync\u201d Command in Linux [8 Practical Examples]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e","name":"Monira Akter Munny","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","caption":"Monira Akter Munny"},"description":"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio","sameAs":["https:\/\/www.facebook.com\/moniramunny05","https:\/\/www.instagram.com\/monira_munny\/","https:\/\/www.linkedin.com\/in\/monira-akter-munny-a76742113\/"],"url":"https:\/\/linuxsimply.com\/author\/munny\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/5258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314897"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=5258"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/5258\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/5272"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=5258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=5258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=5258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}