how to generate file with terminal code example Example 1: how to create new file through terminal touch bar.txt Example 2: create file command line type nul > README.txt