I have made several files with nothing in them I want to know how to put text in.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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:
echo "Sample text here." > sample.txt
The magic part is the redirect operator, > which will add (redirect) the text displayed by echo to a file in the same directory named sample.txt.
There are also editors available on the command line, vim and nano are two popular ones:
nano sample.txt
You’d add your text then hit ctrl+x to save and exit. More handy shortcuts at the bottom of the nano screen.
Finally, you can edit text files locally on your computer then upload them using programs like sftp, scp or rsync - anything that utilizes your Linux user and SSH authentication.
rsync -a sample.txt user@dropletip:/home/username
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.