DEV Community

Discussion on: These are a few of my favorite: Terminal Shortcuts

Collapse
 
dennisfen profile image
Denis Borisevich

Try this:

echo "some text" > new_file.txt

or this (which means basically "write data to the file until you meet EOF label"):

cat > new_file.txt << EOF
new line
another line
EOF

> will rewrite contents of the file
>> will append to the end of the file