I am new to Ubuntu and Linux, and appear to have made a mistake. I was currently logged in as root and was encountering a permission issue in my python file where I could not create a file when using the following.
open('test.txt', 'w')
To resolve this, I ran the following.
sudo chmod -R 777 ~/MyDir
Everything became highlighted in light green, indicating that it is executable. Upon further reading, I understood that this is actually a significant mistake.
I've been fumbling around with various chmod commands, but it seems to be getting worse. Just to make sure that I'm not breaking anything or my program doesn't encounter issues due to my inexperience, how can I reconfigure my directory and files to go back to normal from chmod -R 777 ~/MyDir
to normal files and folders, where I can write with open("text.txt", 'w')
?