Answer the question
In order to leave comments, you need to log in
Is it possible through the terminal, command line to create a file immediately with the contents?
It doesn't matter unix command or windows cmd. I would like to enter something like touch name.txt {'file content'} and get the result.
Thanks
Answer the question
In order to leave comments, you need to log in
On *nix:
cat > file << EOF
blablabla
EOF
Or
echo "blabla" > file
under Win - the command copy con - example - copy con blah.txt - will create a file and write into it what you enter from the keyboard.
Under unix, the echo »blabla command will create a file and write what you type into it.
Well, this is just an example. In general, no one canceled the help and man commands; they work in terminals.
For multiline input, you can use the following command:cat > file.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question