I used this command for my directory structure to change the permissions and it worked fine (as I mentioned before). But still I have a few questions about it. Sounds stupid but I don't fully understand every single piece of the command I'm typing.
Code:
find [YOURDIR] -type d -exec chmod 755 {} \;
If I understand it well, you tell to search for directories, and when a match is found it changes the permissions to 755.
But, for example, I want to look up all the files in a directory with mp3-files that contain "John Denver"
I tried
Code:
find /.../music -type f -exec grep -i john denver
That resulted in ... errr nothing
so I tried
Code:
find /.../music -type f | grep -i john denver
and that one worked!!
So my question is, what is the -exec thing? It tells to run chmod, but what's the difference with the | (pipe)? I'm propably wrong but for me it does exactly the same, the output generated from find is "piped" to grep. Grep itself is only going to show the matches "john denver" (case insensitive -i )
And question nr 2 is why "{} \;" at the end?
as an exercise for myself I tried to list all the mp3-files that had an ID3tag: 1990 in the "year-field"
So I tried:
Code:
user@ubuntu:/.../music$ find -type f -exec id3ed -y 1990 {} \;
File ./e/Emir Kusturica & The No Smoking Orchestra/Life is a Miracle/02-Evergreen.mp3: (tag v1.1)
songname[max:30]: Evergreen
I learned at school a long time ago: "An experiment never fails, it's possible that you don't get the expected result, but again, it never fails"
So the question now is: what am I doing wrong if I want to list all the files in my music directory with an ID3-tag: 1990 in the "year-field"