Whenever I download .docx and .ppt files from my school, they always look like this.
It's pretty annoying to have to rename the file every time I download one, so I want to create a bash script that will do the work for me.
I have a School folder, so I'd like to do a bash script that searches the entire directory and subdirectories for any files that start with the "UTF-8"" prefix, then.
- Have a for loop that removes the prefix from all files starting with that prefix
- Search the filename for occurences of "%20" and replace it with " "
- Monitor the School folder so that any time I download another file with the prefix, it will run the script and immediately rename it.
I am pretty new to linux. I have been researching for the last two hours and I am confused on what I should do. Any help would be greatly appreciated. Thanks!