eg: grep --help > randomtext.txt
echo "This is some text" > randomtext.txt
nano /path/to/file or vi /path/to/file (or any 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