Hello.
I accidently type this command ’ echo -e \n\n"~~ kitty_ipsum_2.txt info ~~" >> kitty_info.txt ’ while completing lesson named " Build a Kitty Ipsum Translator" from Relational Database. Since then, whenever I try to redirect any text using echo, the terminal keeps showing “permission denied.”
e.g
command: echo “sdf” >> kitty_info.txt
output: bash: kitty_info.txt: Permission denied
# With elevated privileges transfer the ownership of the file to the current user.
sudo chown $USER kitty_info.txt
# As normal user that owns the file, changes the permissions of the file.
chmod 744 kitty_info.txt
by seeing this it seems that user do not have necessary permission to write on file.
You have to use the chmod command to change the permission.
chmod kitty_info.txt
This command allows you to write on file.