Published Jun 25, 2022

Linux Fundamentals - Creating files, a short and simple article🧵🐧

avatar

By Traw

Welcome to my Social Blog

As a Linux user, you may find yourself in a situation where you need to create an empty file.

For example, some applications require the presence of a log file before they can write to it. In these cases, the touch command can be used to quickly create an empty file:

Image

The touch command creates the new file you specify and makes you the file's owner.

The file size in the preceding snippet is zero because the touch command simply created an empty file.

The touch command can also be used to modify the time of an existing file, without even changing the file's contents:

Image

Notice, the log.txt file's modification time has been changed from 12:18 to 12:25.

Creating empty files and changing file time stamps is not something you will do on a regular basis on a Linux system, but it is useful to know that it is possible.


That's it for today's article!

Thank you for taking the time to read my brief Linux article!

If you enjoyed this thread, follow me @xtremepentest for future Linux posts, which I will be posting on a daily basis.

Comments