{
    "mode": "man",
    "parameter": "TOUCH",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/TOUCH/1/json",
    "generated": "2026-06-12T05:24:08Z",
    "synopsis": "touch [OPTION]... FILE...",
    "sections": {
        "NAME": {
            "content": "touch - change file timestamps\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "touch [OPTION]... FILE...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Update the access and modification times of each FILE to the current time.\n\nA FILE argument that does not exist is created empty, unless -c or -h is supplied.\n\nA  FILE argument string of - is handled specially and causes touch to change the times of the\nfile associated with standard output.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-a",
                    "content": "",
                    "flag": "-a"
                },
                {
                    "name": "-c --no-create",
                    "content": "do not create any files\n",
                    "flag": "-c",
                    "long": "--no-create"
                },
                {
                    "name": "-d --date",
                    "content": "parse STRING and use it instead of current time\n",
                    "flag": "-d",
                    "long": "--date"
                },
                {
                    "name": "-f     (ignored)",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-h --no-dereference",
                    "content": "affect each symbolic link instead of any referenced file (useful only on systems  that\ncan change the timestamps of a symlink)\n",
                    "flag": "-h",
                    "long": "--no-dereference"
                },
                {
                    "name": "-m",
                    "content": "",
                    "flag": "-m"
                },
                {
                    "name": "-r --reference",
                    "content": "use this file's times instead of current time\n",
                    "flag": "-r",
                    "long": "--reference"
                },
                {
                    "name": "-t",
                    "content": "use [[CC]YY]MMDDhhmm[.ss] instead of current time\n\n--time=WORD\nchange  the  specified  time:  WORD is access, atime, or use: equivalent to -a WORD is\nmodify or mtime: equivalent to -m\n\n--help display this help and exit\n",
                    "flag": "-t"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nNote that the -d and -t options accept different time-date formats.\n",
                    "long": "--version"
                }
            ]
        },
        "DATE STRING": {
            "content": "The --date=STRING is a mostly free format human readable date string such  as  \"Sun,  29  Feb\n2004  16:21:42  -0800\"  or  \"2004-02-29 16:21:42\" or even \"next Thursday\".  A date string may\ncontain items indicating calendar date, time of day, time zone, day of week,  relative  time,\nrelative  date,  and  numbers.  An empty string indicates the beginning of the day.  The date\nstring format is more complex than is easily documented here but is fully  described  in  the\ninfo documentation.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later\n<https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/touch>\nor available locally via: info '(coreutils) touch invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                    TOUCH(1)",
            "subsections": []
        }
    },
    "summary": "touch - change file timestamps",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-c",
            "long": "--no-create",
            "arg": null,
            "description": "do not create any files"
        },
        {
            "flag": "-d",
            "long": "--date",
            "arg": null,
            "description": "parse STRING and use it instead of current time"
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-h",
            "long": "--no-dereference",
            "arg": null,
            "description": "affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink)"
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": "--reference",
            "arg": null,
            "description": "use this file's times instead of current time"
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "use [[CC]YY]MMDDhhmm[.ss] instead of current time --time=WORD change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit Note that the -d and -t options accept different time-date formats."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Create files and set access/modification times.",
        "examples": [
            {
                "description": "Create specific files or update their timestamps if they already exist",
                "command": "touch {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Set the file [a]ccess or [m]odification times to the current one and don't create file if it doesn't exist",
                "command": "touch {{-c|--no-create}} {{a|-m}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Set the file [t]ime to a specific value and don't create file if it doesn't exist",
                "command": "touch {{-c|--no-create}} -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Set the files' timestamp to the reference file's timestamp, and do not create the file if it does not exist",
                "command": "touch {{-c|--no-create}} {{-r|--reference}} {{path/to/reference_file}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Set the timestamp by parsing a string",
                "command": "touch {{-d|--date}} \"{{last year|5 hours|next thursday|nov 14|...}}\" {{path/to/file}}"
            },
            {
                "description": "Create multiple files with an increasing number",
                "command": "touch {{path/to/file{1..10}}}"
            },
            {
                "description": "Create multiple files with a letter range",
                "command": "touch {{path/to/file{a..z}}}"
            }
        ]
    }
}