

{"id":110394,"date":"2022-08-31T14:00:58","date_gmt":"2022-08-31T08:30:58","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=110394"},"modified":"2022-08-31T14:15:45","modified_gmt":"2022-08-31T08:45:45","slug":"touch-command-in-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/","title":{"rendered":"Touch Command in Linux"},"content":{"rendered":"<p>In this article, you will learn all there is to the touch command in Linux. We will go through what the touch command is, why it is used, a brief history, different timestamps of a file, the syntax and options of the touch command, and some practical examples of the touch command in the terminal. So sit down, grab your snacks, and read right till the end!<\/p>\n<h3>What is linux touch command?<\/h3>\n<p>The touch command is a command-line-based utility in Linux-based operating systems that has 2 roles:<\/p>\n<p>1. Modifying a timestamp<\/p>\n<p>2. Creating a file.<\/p>\n<p>The creating files part of the touch command is easy, it can create a file, if and only if the file does not exist. You can even create multiple files using the touch command.<\/p>\n<p>But the touch command can also change timestamps, but first, what is a timestamp? The timestamp is a way of tracking what happened at what time, it is much like history on a timeline.<\/p>\n<p>When we create a file or access it, everything gets logged by a timestamp, using the touch command, we can actually change these timestamps! Speaking in technical language, a timestamp is a piece of information associated with a file that identifies an important time in the file\u2019s history.<\/p>\n<h3>History of the touch command in Linux<\/h3>\n<p>The first appearance of the touch command was in the 7th version of AT&amp;T UNIX. Today, the touch command is available in a range of operating systems, both Linux-based and others like Windows, DOS, macOS, Unix-based, and many more.<\/p>\n<p>The touch command that comes in the package of Coreutils, was written, designed, and developed by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.<\/p>\n<h3>Timestamps of Linux files<\/h3>\n<p>Before we go any further, let us look at the different timestamps a file in the Linux filesystem has. In Linux-based operating systems, a file has 3 timestamps:<\/p>\n<h4>1. atime<\/h4>\n<p>This timestamp stands for \u2018access time\u2019. This timestamp contains the last time the file was either accessed or opened by commands like \u201ccat\u201d, \u201cvim\u201d, \u201cgrep\u201d, \u201cvi\u201d, etc.<\/p>\n<h4>2. mtime<\/h4>\n<p>This timestamp stands for modify time\u2019. This timestamp contains the last time the contents of the file were modified.<\/p>\n<h4>3. ctime<\/h4>\n<p>This timestamp stands for change time\u2019. This timestamp contains the last time the file\u2019s content or attribute was changed. Attributes here mean permissions, location, or ownership.<\/p>\n<p>If you want to display the status of the file including the timestamps of it use the \u201cstat\u201d command as shown below.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/finding-the-status-of-a-file-by-using-the-stat-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110430\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/finding-the-status-of-a-file-by-using-the-stat-command.webp\" alt=\"finding the status of a file by using the stat command\" width=\"780\" height=\"217\" \/><\/a><\/p>\n<h3>Syntax of Linux touch command<\/h3>\n<p>As we have seen, the touch command has 2 roles (creating files and modifying timestamps), let us take a look at the syntax of the touch command on each case:<\/p>\n<p>The syntax for creating files using the touch command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch &lt;options&gt; &lt;filename&gt;<\/pre>\n<p>The syntax for creating files consists of 2 fields, one is for options (which we will look into in the next section) and the other is for entering the name of the file you want to create.<\/p>\n<p>The syntax for modifying timestamps using the touch command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch &lt;options&gt; &lt;timestamp&gt; &lt;filename&gt;<\/pre>\n<p>The syntax for modifying timestamps consists of 3 fields, the first one is for the options, the second for the timestamp you want to modify to, and the third is the filename you want to modify the timestamps of.<\/p>\n<h3>Options used with Linux touch command<\/h3>\n<p>In both the syntaxes of the touch command, there is a field for options where we can enter a range of available options with which we can specify how touch should function and also how the output should be formatted. Let us look at the options available with the touch command.<\/p>\n<h4>1. -a<\/h4>\n<p>This option sets only the access time.<\/p>\n<h4>2. -c<\/h4>\n<p>This option does not create files. You can also write this option as \u201c&#8211;no-create\u201d.<\/p>\n<h4>3. -d<\/h4>\n<p>This option parses the date string and uses it instead of the current time.<\/p>\n<h4>4. -f<\/h4>\n<p>This option does nothing, nonetheless, it is accepted to provide compatibility with BSD versions of the touch command.<\/p>\n<h4>5. -h<\/h4>\n<p>This option makes the touch command modify the timestamp of symlink rather than its referenced file if the file you specified is a symbolic link. You can also write this option as \u201c&#8211;no-dereference\u201d<\/p>\n<h4>6. -m<\/h4>\n<p>This option sets only the modification time.<\/p>\n<h4>7. \u2013r<\/h4>\n<p>This option sets the time of the file you specified to the times of the file reference file you specified instead of the current time.<\/p>\n<h4>8. -t<\/h4>\n<p>This option uses the numeric timestamp instead of the current time. You can use the format:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">[[CC]YY]MMDDhhmm[.ss]<\/pre>\n<h4>9. &#8211;help<\/h4>\n<p>This option displays the help menu as follows<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/help-menu-of-the-touch-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110431\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/help-menu-of-the-touch-command.webp\" alt=\"help-menu of the touch command\" width=\"780\" height=\"664\" \/><\/a><\/p>\n<h4>10. &#8211;version<\/h4>\n<p>This option displays information about the version of the touch command<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/version-of-the-touch-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110432\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/version-of-the-touch-command.webp\" alt=\"version of the touch command\" width=\"780\" height=\"199\" \/><\/a><\/p>\n<p>Now that we have laid down the fundamentals, let us look at how to put all of this into action. Let\u2019s start with the simple thing first: creating files using the touch command.<\/p>\n<h3>Creating a single file using the touch command<\/h3>\n<p>To create a single simply use the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch &lt;filname&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-a-single-file-using-the-touch-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110433\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-a-single-file-using-the-touch-command.webp\" alt=\"creating a single file using the touch command\" width=\"658\" height=\"141\" \/><\/a><\/h3>\n<h3>Creating multiple files using Linux touch command<\/h3>\n<p>To create multiple files at once using the touch command, let us look at them one by one. The first method is to simply name the files you want to create one after the other as shown: touch &lt;file1&gt; &lt;file2&gt; &lt;file3&gt;.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-multiple-files-using-the-touch-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110434\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-multiple-files-using-the-touch-command.webp\" alt=\"creating multiple files using the touch command\" width=\"780\" height=\"127\" \/><\/a><\/p>\n<p>Another method we can use to create multiple files is to use {start .. finish}, use the syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch &lt;filename {&lt;start&gt;..&lt;finish&gt;}&gt;<\/pre>\n<p>For example, the command \u201ctouch linux{1..5}\u201d will create the files \u2018linux1\u2019, \u2018linux2\u2019, \u2018linux3\u2019, \u2018linux4\u2019, and \u2018linux5\u2019.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-multiple-files-using-the-touch-command-by-specifiying-a-range.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110435\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/creating-multiple-files-using-the-touch-command-by-specifiying-a-range.webp\" alt=\"creating multiple files using the touch command by specifiying a range\" width=\"692\" height=\"145\" \/><\/a><\/p>\n<p>That is pretty much it for creating files with the touch command, let us now see how to modify and set timestamp using the touch command.<\/p>\n<p>Before we look at how to modify timestamps, let us see how to display them, we can make use of the \u201cstat command\u201d, but we can also use the command \u201cls -l\u201d.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/printing-detailed-information-about-a-file-by-using-the-ls-l-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110436\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/printing-detailed-information-about-a-file-by-using-the-ls-l-command.webp\" alt=\"printing detailed information about a file by using the ls l command\" width=\"778\" height=\"237\" \/><\/a><\/p>\n<h3>Setting a specific timestamp with the touch command<\/h3>\n<p>To set a specific timestamp pair the touch command with the option \u201c-t\u201d followed by the specific timestamp in the following format [[CC]YY]MMDDhhmm[.ss], where<\/p>\n<ul>\n<li>CC stands for the first two digits of a year<\/li>\n<li>YY stands for the last two digits of a year<\/li>\n<li>MM stands for the month<\/li>\n<li>DD stands for the day<\/li>\n<li>hh stands for the hour<\/li>\n<li>mm stands for the minutes<\/li>\n<li>ss stands for the seconds<\/li>\n<\/ul>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-a-specific-timestamp-with-the-touch-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110437\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-a-specific-timestamp-with-the-touch-command.webp\" alt=\"setting a specific timestamp with the touch command\" width=\"780\" height=\"182\" \/><\/a><\/p>\n<h3>Setting a file stamp using a date string<\/h3>\n<p>Instead of using the format shown above, we can use standard date convection and also English statements to set the timestamps. We can do so by using the option \u201c-d\u201d followed by the string you want to set the timestamp to as shown:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -d &lt;string&gt; &lt;filename&gt;<\/pre>\n<p>Before we see an example, let us see what all values and formats we can enter in the \u201cstring\u201d.<\/p>\n<p>1. Calendar dates &#8211; 19 June 2003<\/p>\n<p>2. Time of the day &#8211; 10:37pm<\/p>\n<p>3. Days of the week &#8211; Monday<\/p>\n<p>4. Relative time &#8211; tomorrow, next week, 5 years ago, yesterday, etc.<\/p>\n<p>For example, the command \u201ctouch -d tomorrow &lt;filename&gt;\u201d will change the date of the timestamp to tomorrow&#8217;s date.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-a-file-stamp-using-a-date-string.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110438\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-a-file-stamp-using-a-date-string.webp\" alt=\"setting a file stamp using a date string\" width=\"766\" height=\"192\" \/><\/a><\/p>\n<h3>Changing access date to today&#8217;s date<\/h3>\n<p>If you want to change the access date ( timestamp that contains the last time the file was either accessed or opened by commands like \u201ccat\u201d, \u201cvim\u201d, \u201cgrep\u201d, \u201cvi\u201d, etc) we can use the option \u201c-a\u201d as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -a &lt;filename&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-access-date-to-todays-date.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110439\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-access-date-to-todays-date.webp\" alt=\"changing access date to todays date\" width=\"734\" height=\"214\" \/><\/a><\/p>\n<p>In the above output, the access time has been changed from 7th May 2022 to 6th May 2022.<\/p>\n<h3>Explicitly changing access time<\/h3>\n<p>Using only the option \u201c-a\u201d changes the atime to today&#8217;s date, but what if you want to specifically change it to some other date, well, we pair it with the option \u201c-t\u201d followed by the date in the format [[CC]YY]MMDDhhmm[.ss].<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/explicitly-changing-access-time.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110440\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/explicitly-changing-access-time.webp\" alt=\"explicitly changing access time\" width=\"780\" height=\"186\" \/><\/a><\/p>\n<h3>Changing access date to today&#8217;s date<\/h3>\n<p>If you want to change the access date (timestamp contains the last time the contents of the file were modified) we can use the option \u201c-m\u201d as shown: touch -a &lt;filename&gt;.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-access-date-to-todays-date.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110439\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-access-date-to-todays-date.webp\" alt=\"changing access date to todays date\" width=\"734\" height=\"214\" \/><\/a><\/p>\n<p>In the above output, the modify time has been changed from 1st January 1999 to 6th May 2022.<\/p>\n<h3>Explicitly changing modification time<\/h3>\n<p>Using only the option \u201c-m\u201d changes the atime to today&#8217;s date, but what if you want to specifically change it to some other date, well, we pair it with the option \u201c-t\u201d followed by the date in the format [[CC]YY]MMDDhhmm[.ss].<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/explicitly-changing-modification-time.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110441\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/explicitly-changing-modification-time.webp\" alt=\"explicitly changing modification time\" width=\"790\" height=\"195\" \/><\/a><\/p>\n<h3>Changing both access and modification time at once<\/h3>\n<p>If you want to change both the access time and modification time t0 today\u2019s date in just one command, you can do so by combining the options \u201c-a\u201d and \u201c-m\u201d as shown:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -am &lt;filename&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-both-access-and-modification-time-at-once.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110442\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-both-access-and-modification-time-at-once.webp\" alt=\"changing both access and modification time at once\" width=\"720\" height=\"349\" \/><\/a><\/h3>\n<h3>Avoid creating a new file<\/h3>\n<p>We have seen that the touch command creates files if they don\u2019t exist, sometimes we may have to override this functionality. To do so, use the option \u201c-c\u201d as shown:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -c &lt;filename&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/avoid-creating-a-new-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110443\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/avoid-creating-a-new-file.webp\" alt=\"avoid creating a new file\" width=\"678\" height=\"184\" \/><\/a><\/h3>\n<h3>Set timestamp using a symbolic link<\/h3>\n<p>To change the timestamp of a symbolic link, use the option \u201c-h\u201d using the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -h &lt;filename&gt;<\/pre>\n<h3>Set the timestamp using a reference file<\/h3>\n<p>If you want to set the timestamp of a file as the timestamp of another file, use the option \u201c-r\u201d followed by the reference file and the file you want to change the timestamp, here is the syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">touch -r &lt;reference file&gt;&lt;file&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-the-timestamp-using-a-reference-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110444\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/setting-the-timestamp-using-a-reference-file.webp\" alt=\"setting the timestamp using a reference file\" width=\"688\" height=\"233\" \/><\/a><\/h3>\n<h3>Touch vs cat command in Linux<\/h3>\n<p>Touch or cat? Which one is better? Frankly speaking, the question is incomplete, it depends on which grounds you are speaking, because, touch is clearly the winner in terms of modifying timestamps and cat is clearly the winner in displaying the content of the file.<\/p>\n<p>However, they both have a slim common ground &#8211; creating files, if we talk about which command is better for creating files, hands down the appreciation goes to the cat command. Why? Because the cat command can not only create files, but can also edit, combine, display, and so much more.<\/p>\n<h3>Summary<\/h3>\n<p>As you have seen, the touch command is a really simple tool that helps you create files and modify timestamps of files and directories. You have now learned what the touch command is, a brief history of it, the different timestamps of Linux files, and the syntax and options of the touch command. You have also learned many practical examples of the touch command in the terminal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn all there is to the touch command in Linux. We will go through what the touch command is, why it is used, a brief history, different timestamps of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":110428,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[27058],"class_list":["post-110394","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-touch-command-in-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Touch Command in Linux - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about linux touch command, its use, history, different timestamps of a file, syntax and options of the touch command with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Touch Command in Linux - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about linux touch command, its use, history, different timestamps of a file, syntax and options of the touch command with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-31T08:30:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-31T08:45:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Touch Command in Linux - DataFlair","description":"Learn about linux touch command, its use, history, different timestamps of a file, syntax and options of the touch command with examples.","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:\/\/data-flair.training\/blogs\/touch-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"Touch Command in Linux - DataFlair","og_description":"Learn about linux touch command, its use, history, different timestamps of a file, syntax and options of the touch command with examples.","og_url":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-08-31T08:30:58+00:00","article_modified_time":"2022-08-31T08:45:45+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Touch Command in Linux","datePublished":"2022-08-31T08:30:58+00:00","dateModified":"2022-08-31T08:45:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/"},"wordCount":1683,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp","keywords":["Touch Command in Linux"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/","url":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/","name":"Touch Command in Linux - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp","datePublished":"2022-08-31T08:30:58+00:00","dateModified":"2022-08-31T08:45:45+00:00","description":"Learn about linux touch command, its use, history, different timestamps of a file, syntax and options of the touch command with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/touch-command-in-linux.webp","width":1200,"height":628,"caption":"touch command in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/touch-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"Touch Command in Linux"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=110394"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110394\/revisions"}],"predecessor-version":[{"id":110445,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110394\/revisions\/110445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110428"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=110394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=110394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=110394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}