I messed up permissions and ownership
I copied over files from a FAT32 drive to a EXT3 drive and the permissions are all out of whack:
Code:
digity@bighouse:/media/morningside/workspace# ls -la [1] get groups and others able to open all sub-folders/directories [2] read & write permissions for digity for all files & folders recursively (which i'd imagine would be the group) [3] get root (user/owner) only read & write permissions for all files recursively |
Code:
cd /media/morningside/workspace |
The fat32 filesystem can't contain Linux permissions & ownership, so the entire partition is mounted with all files having the same ownership and permissions. The same goes for all the directories. These permissions are determined when you mount the partition. Anyway, you can simply use chown to change the ownership and chmod to change the permissions. The find command can search for only directories or only files and apply a command to what it finds. You can use the "-R" recursive option to chown to change the groups and ownership of all of the files at once.
Code:
cd /media/morningside/workspace |
There is also a recursive (-R) option to chmod.
|
Quote:
This is so common, I have some bash functions dchmod and fchmod to perform the actions: Code:
function dchmod { |
thanx everyone! i essentially found a solution elsewhere that is exactly what jschiwal recommended.
everything is working beautifully now! thanx again folks! |
Sadly, I hadn't noticed your member name was digity. Sorry.
|
being a noon to this wonderous stuff these commands are all strange to me but hope to master some of them, nice to see te help given by members on the board
|
Quote:
for folders/directories: Code:
sudo find ./ -type d -exec chmod ug=rwx {} \; Code:
sudo find ./ -type f -exec chmod ug=rw {} \; |
All times are GMT -5. The time now is 04:35 AM. |