A way to paste from clipboard to file without any tools except echo
.
'
with '\''
and copy the result to clipboard.echo -n '
Shift+Insert
' > filename.txt
Enter
Basically you're doing this:
echo -n 'copied text with single quotes escaped' > filename.txt
It works even if the copied text has new lines.