How can I make chown work recursively?
Problem
I've got a directory called that contains a bunch of sub- and sub-sub-directories. I want to change ownership on all PDF files in all of the subfolders. I just tried this: ...but it didn't change ownership of the PDFs in subdirectories. The user and group do exist. According to the man page for , the should mean recursive: What am I missing?
Error Output
chown -R someuser:somegroup *.pdf
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: How can I make chown work recursively?
Recursive mode only works on directories, not files. By using the glob '*.pdf' the shell is passing the file list to chown, which sees these are files, and changes the permissions on the files it sees, and that's it. Remember, in shells, the glob is evaluated by the shell, not the command. If the glob matches files, they are passed to the command and the command never knows a glob existed. (This is different than how Windows Command prompt used to do things). If you have a dir, with the content…
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix