I have made several files with nothing in them I want to know how to put text in.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi,
There are many ways to create text files on Linux. One of the simpler examples is using echo and the operator to write to a file:
The magic part is the redirect operator,
>
which will add (redirect) the text displayed byecho
to a file in the same directory namedsample.txt
.There are also editors available on the command line,
vim
andnano
are two popular ones:You’d add your text then hit
ctrl+x
to save and exit. More handy shortcuts at the bottom of thenano
screen.Finally, you can edit text files locally on your computer then upload them using programs like
sftp
,scp
orrsync
- anything that utilizes your Linux user and SSH authentication.Hope this helps - if you need additional help please tell us a little more about what you are trying to do so we can give more specific advice!