How to Create a File using Terminal on Mac

By Rashid •  August 7th, 2022 • 

Having some command-line knowledge is always helpful for PC users. Let’s check how to create a file using the command line on Mac in this short tutorial.

You can create a new file using the touch command. Just navigate to your preferred location and open the terminal from there.

For example, you can create a text file using the following command.

touch test.txt

That’s it, a text file named test.txt will be created on your preferred directory.

That’s how you create a file using terminal on Mac.


I am a fan of Ubuntu and I love all popular free and open source softwares. I wish everyone should try and support open source projects.

Keep Reading