Last updated on May 30th, 2018 at 09:56 am
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.
If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.
I am Hafiz Haider, co-founder of BroExperts.com. A Computer Geek and a certified Linux enthusiast (RHCE, RHCSA), who strongly believes in sharing knowledge.. You can reach me at email@example.com.