Hello fellow HTBlers,
I need help understanding something. There is a User Folder somewhere with a py-File in it. I’m in some kind of a bash where it’s not possible to use nano or vi. Now I want to edit the content of this py-File and my solution would be sudo -u USERNAME echo “something” /USERDIR/something.py. But nothings happens.
I can however do ls -ls with sudo -u, I can can cat the content of the File with sudo -u and create a new File with touch. However, echo into the new File won’t work either. Can someone explain to me why? Is there another way to edit a File without starting an editor? I only know echo should do this.