I'm a bit of a UNIX noob, but I'm trying to run the cat command to make a simple text file and it works great, however cat is never exited after making the file. For instance, I type cat > ~/mytextfile.txt and hit enter, the file is created but my cursor remains on a blank line.
33 Answers
You're telling cat to send nothing to a file. Use touch (as mentioned) instead.
You have to send an EOF (^D) character on the standard input to tell cat to stop.
In my MAC I need to send EOF (^D) twice.
Example:
cat > /tmp/mypassword
RandomLettersAndNumbers123Then press FN + Control + D twice.