You will create new empty file using touch command in Linux, this command also used to change the time stamps such as modification time and access time on existing files.


Syntax of touch command:

$ touch [option] filename

Examples-1: To create a file in present working directory, just use the following command:

$ touch mydata.txt

Examples-2: Use the absolute path to create file other than the present working directory:

$ touch /tmp/LinuxBasics/mydata.txt

In next coming lessons we will learn how to write data in text and config files by using vi text editor.

Next: Rename/Move or Delete Directory and Files in Linux

If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.


Similar Posts