Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Linux by (18.4k points)

My command is something like this:

cat "Some text here." > myfile.txt

Possible? Such that my contents of the myfile.txt would now be overwritten to:

Some text here.

This is not working for me but also doesn't throw errors.

Specifically interested in the cat-based solution (not vim/vi/emacs, etc.). 

1 Answer

0 votes
by (36.8k points)

This what echo does:

echo "Some text here." > myfile.txt

Want to be a Linux expert? Come and join this Linux course

 

Related questions

0 votes
1 answer
asked Apr 11, 2021 in Linux by dev_sk2311 (44.4k points)
0 votes
1 answer
asked Nov 22, 2020 in Linux by blackindya (18.4k points)
0 votes
1 answer
0 votes
1 answer
asked Nov 30, 2020 in Linux by dev_sk2311 (44.4k points)

Browse Categories

...