PDA

View Full Version : [SOLVED] Bulk file permission changes



Ducatiboy Stu
January 13th, 2010, 03:59 AM
I recently installed karmic on my laptop, overwriting hardy

I took a back-up of my /home dir , then copied them back into my /home from my ext drive

But i forgot the permissions are different and the only way to access them is through sudo

There a a look of directories and even more files with those that i nee to change the permissions on to make life easier

what is the easiest way to do this as a batch/ bulk change

Ankur Dave
January 13th, 2010, 07:48 AM
To bulk-change the ownership of a directory, try the following command in a terminal:


sudo chown -R $USERNAME: <directory>

The -R option is short for --recursive; it changes the permissions of the directory and everything it contains. The colon (":") after the username tells chown to change the user and the group.

Make sure to replace "<directory>" with the directory you want to change. That's probably /home/$USERNAME, or ~, in this case.

Hope that helps!

audiomick
January 13th, 2010, 10:43 AM
Hallo.
My home has a few things in it belonging to root.
They are
.dbus directory drwx------
.ure directory drwxr-xr-x
karmic.list text file -rw-r--r--
.nvidia-settings-rc text file -rw-r--r--

If you have any of these, I would suggest leaving them like that.

Ducatiboy Stu
January 13th, 2010, 11:51 AM
To bulk-change the ownership of a directory, try the following command in a terminal:


sudo chown -R $USERNAME: <directory>

The -R option is short for --recursive; it changes the permissions of the directory and everything it contains. The colon (":") after the username tells chown to change the user and the group.

Make sure to replace "<directory>" with the directory you want to change. That's probably /home/$USERNAME, or ~, in this case.

Hope that helps!

Thanks

Worked a treat, I know there was an easy way, just could remember the command

:popcorn: