Change Folder/File Permissions for HIDDEN Subdirectories

5,603

You need to use the -R flag, which will recurse into every subdirectory. For example, running sudo chown -R my_username:my_username .hidden will make .hidden and all subdirectories owned by you.

The * glob doesn't match any hidden directories (directories starting with a .).

Share:
5,603

Related videos on Youtube

Izzhov
Author by

Izzhov

Updated on September 18, 2022

Comments

  • Izzhov
    Izzhov over 1 year

    This question is very similar to Change Folder & File Permissions for all Subdirectories , which worked for me completely when the folders weren't hidden. However, I have a hidden folder (call it /.hidden/) with many subdirectories, most of which have permissions set for root and not my_username. I want to change the permissions of all these subdirectories at once, if possible. However, if I cd /.hidden/ and then type "sudo chown my_username:my_username *", none of the file or folder permissions get changed, presumably because they're still considered "hidden" by the command even though I can see them. Anyone know an easy way around this?

    • heemayl
      heemayl almost 9 years
      Do you want to change the permission only on the directories or files too? Also are the subdirectories also hidden?
    • Izzhov
      Izzhov almost 9 years
      All files and subdirectories in /.hidden/ are also hidden. I want to change the owner of every file and subdirectory in /.hidden/ to my_username.