Reset folders to default state ( permissions )
I have asked this question before, but i wrote it on paper and forgot how the command was. I have an old ntfs usb hdd that ive had some music on, and when i copy that, some folders have had executive permissions, some are completely wrong, i would like to recursively reset files and folders to their default state. Thanks in advance :)
About this post
- Posted
- Archived
- Score
- 2 · 100% up
- Kind
- Text
- ID
- fbaed3
6 comments
As in remove the executable flag? Some combination of chmod -R -x
https://www.gnu.org/software/coreutils/chmod
Yes, all the mp3 files are executable, some folders too so i cannot enter them. Someone had shared a really good command combo that i forgot that worked like magic
chmod -R u=rwX,go=rX Music/
Capital X stands for traversable (for directories) but not executable (for files)
it's the chmod -R command you want. if need be, you could search by file extension.
find . -type f -name "*.mp3" -exec chmod 644 {} ;
And how to go reverting directories to normal?
find . -type d -exec chmod nnn {} \;where nnn if the permissions for directory. probably 775. 664 for files with f instead of d.. means current dir. So be at the root where you want to fix or specify with full directory. you can do d or f for files and directory. See the man page for more info.