I am currently taking the Google cybersecurity coursera cert course. I am now in the Linux section and learning a few Linux commands, I am totally new to it but I was wondering about one thing. While I am learning I always try to think of how a defender or an attacker might use said command and recently I learnt about echo > command and how it can overwrite everything. I did check that it can be used maliciously but of course I did not understand it completely.
My question is, let's say and attacker gets access to someone's computer and wants to quickly do some damage to the user knowing he has many .txt files. Would this command work?
find /home/ -name "*.txt*" | echo "gg" > "*.txt*"
Just wondering if I am understanding this correctly. Would this basically create a command that finds all .txt files under /home/ and then pipe echo to overwrite all .txt files with the word gg?
If not, why does it not work exactly? I would like to understand why it wont work to help me understand it better, and if the idea technically works but the command is written wrong, let me know which part is wrong about it.