Depending on what you want the file to contain:
touch /path/to/filefor an empty file-
somecommand > /path/to/filefor a file containing the output of some command.eg: grep --help > randomtext.txt echo "This is some text" > randomtext.txt -
nano /path/to/fileorvi /path/to/file(orany other editor emacs,gedit etc)
It either opens the existing one for editing or creates & opens the empty file to enter, if it doesn’t exist