Difference between revisions of "Touch (command)"

From wikieduonline
Jump to navigation Jump to search
 
(27 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<code>touch</code><ref>https://en.wikipedia.org/wiki/Touch_(command)</ref> is a command used to update the access date and/or modification date of a computer file or directory or to create it.
+
{{lowercase}}
 +
<code>touch</code><ref>https://en.wikipedia.org/wiki/Touch_(command)</ref> is a command used to update the access date and/or modification date of a computer [[file]] or directory or to create it.
  
<pre>
+
 
touch /etc/resolv.conf
+
*<code>touch [[/etc/resolv.conf]]</code>
touch: cannot touch '/etc/resolv.conf': No such file or directory
+
*<code>touch: cannot touch '/etc/resolv.conf': No such file or directory</code>
</pre>
+
 
 +
 
 +
touch file.txt
 +
touch: cannot touch 'file.txt': [[Read-only file system]]
 +
 
 +
 
 +
* <code>[[mkdir -p]] "$(dirname "$1")" && [[touch]] "$1"</code>
 +
 
 +
 
 +
* <code>[[touch]] ~/[[.ssh]]/[[authorized_keys]]</code>
 +
 
 +
 
 +
*<code>touch [[.pg_service.conf]]</code>
 +
 
 +
===missing file operand===
 +
  touch
 +
touch: missing file operand
 +
Try '[[touch --help]]' for more information.
 +
 
 +
 
 +
== Related commands ==
 +
* <code>[[truncate]]</code>
 +
* <code>[[fallocate]]</code>
 +
* <code>[[type]] nul > [[authorized_key]]</code> ([[Windows]])
 +
* <code>[[rm]]</code>
 +
* <code>[[mkdir -p]]</code> or <code>[[mkdir --parents]]</code>
 +
* <code>[[install]] -D /dev/null /path/to/createfile.txt</code>
 +
* New-Item example.txt
  
 
== See also ==
 
== See also ==
* [[chattr]]
+
* {{files}}
  
  
[[Category:Linux]]
+
[[Category:Linux commands]]

Latest revision as of 15:44, 23 August 2023

touch[1] is a command used to update the access date and/or modification date of a computer file or directory or to create it.


  • touch /etc/resolv.conf
  • touch: cannot touch '/etc/resolv.conf': No such file or directory


touch file.txt
touch: cannot touch 'file.txt': Read-only file system




missing file operand[edit]

 touch
touch: missing file operand
Try 'touch --help' for more information.


Related commands[edit]

See also[edit]

  • https://en.wikipedia.org/wiki/Touch_(command)
  • Advertising: