How to overwrite file using echo?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 How To Overwrite File Using Echo?
00:20 Accepted Answer Score 49
00:37 Thank you
--
Full question
https://superuser.com/questions/414465/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #bash
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3
--
Chapters
00:00 How To Overwrite File Using Echo?
00:20 Accepted Answer Score 49
00:37 Thank you
--
Full question
https://superuser.com/questions/414465/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #bash
#avk47
ACCEPTED ANSWER
Score 49
>
is for redirecting to a file (overwriting it), while >>
is for appending.
To overwrite bar.txt
, use this:
echo "foo" > bar.txt