Sometimes, it is necessary to create a short file that doesn't require us to invoke the full text editor. In those scenarios, the echo or printf command is used with the redirection operator to create an empty file, or a file with a single line. This method of creating a file can be used in scripts also. Use the echo and printf command is shown in the following screenshot: