commands
touch — update timestamps or create empty files
Updates access and modification times by default; a missing ordinary file is created empty unless creation is disabled. Existing file data is not truncated. Examples assume a fresh chapter files lab.
Formal Syntax & Structure
linux syntaxlinux
touch [OPTION]... FILE...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -c | option | Do not create a missing file |
| -m | option | Change only modification time |
| FILE | operand | File to touch |
Return Value
filesystem change and exit status
GNU touch returns 0 on successful timestamp updates or creation and nonzero on failure. Inspect file metadata and existence; existing contents are not replaced by this operation.
Working Example
Example Snippetlinux
touch notes/new.txt