How do you creat a file without even opening it?
-
more <filename>
-
pico <filename>
-
cat <filename>
-
touch <filename>
The touch command creates an empty file without opening it in any editor. It simply updates the file's timestamp if it exists, or creates a new empty file if it doesn't. This is the standard Unix/Linux way to quickly create files. The other commands (more, pico, cat) either open files for viewing or editing, or require piping content.
touch is correct — it's the standard Unix/Linux command specifically designed to create an empty file (or update timestamps on an existing one) without opening it in any editor or pager. more and cat are for viewing/displaying file contents (and would error or just return nothing on a non-existent file rather than creating it, depending on shell/redirection), and pico is a text editor that would open the file for editing, which is exactly what the question asks to avoid.