The `touch` command's primary function is to modify a timestamp. Commonly, the utility is used for file creation, although this is not its primary function. The terminal program can change the modification and access time for any given file.
The fundamental syntax for the touch command is:
`touch <options> <file or directory name>`
Some of the touch Command Options:
-`-a` Changes the access time.
-`-d=<string>` Changes a timestamp using a date string.
-`-m` Changes the modification time.
```console
$ touch test.txt
$ ls -lu
-rw-rw-r-- 1 user user 0 dez 27 12:13 test.txt
$ touch -a test.txt
$ ls -lu
-rw-rw-r-- 1 user user 0 dez 27 12:20 test.txt
$ touch -d tomorrow test.txt
$ ls -l
-rw-rw-r-- 1 user user 0 dez 28 2022 test.txt
$ touch -m test.txt
$ ls -l
-rw-rw-r-- 1 user user 0 dez 27 12:25 testing.txt
```
Sometimes we need to remove the content of a file without deleting the file. For that Linux operating system offers a command called `truncate`. It is used to extend or reduce the file size. Truncating a file is much quicker and simpler without modifying the permissions and ownership of the file.
```console
$ touch test.txt
$ ls -l
-rw-rw-r-- 1 user user 0 dez 27 12:13 test.txt
$ truncate -s 100 test.txt
$ ls -l
-rw-rw-r-- 1 user user 100 dez 27 12:15 test.txt
```
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!