Networking / Beginners

The touch command

The touch command is one of the more interesting Linux file management commands. Here's the syntax:

touch [options] file

Here are some of the options that you can use:

  • -a: Changes the access time only.
  • -c: Doesn't create files that don't exist.
  • -m: Changes the modification time only.

The basic form of the touch command looks like this:

$ touch monthly.report

If you use touch on an existing file, the touch command changes the modification date of the file. If you use it on a command that doesn't exist, the touch command creates a new, empty file.

[Previous] [Contents] [Next]