I know : echo "blah blah" >file.txt
works.
and that echo "" >file.txt
works too.
but, what if I want to echo only ONE "
(double quote) in a file.
echo ">file.txt
doesn't work, is it possible doing it in a one line command?
echo accepts a number of escape sequences that start with a backslash. These sequences in Table A-12 exhibit fairly predictable behavior, except for \f , which on some displays causes a screen clear while on others it causes a line feed, and it ejects the page on most printers.
\e - Displays an escape character. \f - Displays a form feed character. \n - Displays a new line. \r - Displays a carriage return.
Using '>>' with 'echo' command appends a line to a file. Another way is to use 'echo,' pipe(|), and 'tee' commands to add content to a file.
The escape character for the Windows shell is ^
, so:
echo ^" > file.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With