Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Deprecated
    • Env
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

touch for filesystem

Creates one or more files.

Signature

> touch {flags} ...rest

Flags

  • --reference, -r {string}: change the file or directory time to the time of the reference file/directory
  • --modified, -m: change the modification time of the file or directory. If no reference file/directory is given, the current time is used
  • --access, -a: change the access time of the file or directory. If no reference file/directory is given, the current time is used
  • --no-create, -c: do not create the file if it does not exist
  • --no-deref, -s: do not follow symlinks

Parameters

  • ...rest: The file(s) to create.

Input/output types:

inputoutput
nothingnothing

Examples

Creates "fixture.json"

> touch fixture.json

Creates files a, b and c

> touch a b c

Changes the last modified time of "fixture.json" to today's date

> touch -m fixture.json

Changes the last modified time of file d and e to "fixture.json"'s last modified time

> touch -m -r fixture.json d e
Edit this page on GitHub
Contributors: ibraheemdev, Jonathan Turner, JT, hustcer, Reilly Wood, Justin Ma, Leon, Hofer-Julian, Stefan Holderbach, Texas Toland, sholderbach