how to write txt file from command line code example Example: make text file command line cat > sample.txt # Write some text, press Ctrl+D when you are done