Changing File Permissions in Ubuntu

Ok, so I have all my files on a back up external hard drive. I got a new hard drive for my computer and I want to transfer all my files to my new system. But after transferring them it tells me I don’t have permission to access them. What do you do?

Unfortunately the only way to change file permissions in mass is through the terminal.There is no GUI (Graphical User Interface) that will work.

To change group ownership for all files in a directory type the following in the terminal, replacing “jay” with your user ID. It is case-sensitive. Please be careful, you are using sudo which is powerful. This is valid as of February 2011.

sudo chown :jay -R /home/jay/Documents/
sudo chown :jay -R /home/jay/Music/
sudo chown :jay -R /home/jay/Pictures/
sudo chown :jay -R /home/jay/Videos/
sudo chown :jay -R /home/jay/Downloads/

To change group ownership for all files in an external USB device.

sudo chown :jay -R /media/USBdrive/

To change file ownership for all files in a directory type the following in the terminal, replacing “jay” with your user ID. Notice the only difference is the absence of “:”

sudo chown jay -R /home/jay/Documents/
sudo chown jay -R /home/jay/Music/
sudo chown jay -R /home/jay/Pictures/
sudo chown jay -R /home/jay/Videos/
sudo chown jay -R /home/jay/Downloads/

To change file ownership for all files in an external USB device.

sudo chown jay -R /media/USBdrive/

The “sudo” gives you root access, the “chown” changes ownership. The “-R” means to apply to all files in the directory, and the rest is the location of the directory to be modified. You can’t apply it to “/home/jay/” because there are some files that need to be protected.

Published by

Jay Forrest

Jay N. Forrest is an IT professional, an ordained Humanist minister, and a Certified and Accredited Meditation Teacher.