"cat" command fails to create a usable txt file. Is there something I need to make sure of?
What could be causing my new combined files to be created as 0 byte empty files? I saved them as UTF-8. Is that wrong?
MacBook Pro 13″, macOS 11.5
What could be causing my new combined files to be created as 0 byte empty files? I saved them as UTF-8. Is that wrong?
MacBook Pro 13″, macOS 11.5
If you are still in the Bash 3 shell, you can create an empty file by the following commands in the Terminal:
>foo.txt
or
touch foo.txt
or
echo "" > foo.txt
or
cat /dev/null > foo.txt
All but the first example work in the Zsh shell. Ordinarily, on a UNIX system, one does not use cat in this manner to create an empty file, but rather the touch command. The cat command is more for concatenating n-tuple files into a final file, or reviewing the content of an existing text file for bogus line endings, to name a couple of usages.
"cat" command fails to create a usable txt file. Is there something I need to make sure of?