linux create new txt file code example Example 1: create file in linux touch <filename>.<extension> Example 2: How do you create a file in shell script? touch NewFile.txt