Create a file with newline symbol in Linux

If for some reasons one needs to create a file with UTF symbols in filename, the following command helps:

touch new$'\n'file.txt


Or you can simply rename existing file:

mv goodfile.txt bad$'\n'file.txt
mv goodfile.txt $'bad\nfile.txt'


Hope this helps 🙂

Tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *