4 ms·
Among the uses of cat, I saw no one mention you can write or append text to a file, like this : cat > file.txt # after this command, just type your text
by az09mugen 3y ago
Among the uses of cat, I saw no one mention you can write or append text to a file, like this :
cat > file.txt # after this command, just type your text
Or to append :
cat >> file.txt
Can also work with Here Doc syntax :
cat > file.txt << EOF
This is the text to write down
EOF
- hinkley 3y agoSomewhere along the way it had been so long since I used cat to concatenate files that I had to relearn to do so. That felt either very silly or, “I’ve forgotten more about X than you’ll ever know” But probably the former.