Ubuntu – You do not have the permissions necessary to view the contents of “folder”

dual-bootpermissions

I had Windows installed before and I downloaded some files while using it.Then I installed Backtrack 5 R3 as dual boot and copied the files on windows to BT when BT was booted, and it was successful. (Also I always logged in as root on BT) Then I deleted Windows and installed Ubuntu 14.04 as dual boot and copied the files on BT to Ubuntu.

The problem is that when I want to open or access the files on Ubuntu when Ubuntu is booted, i can't; I get the error message

You do not have the permissions necessary to view the contents of “files”

I can however use the ls command with sudo to sudo ls files but can't use cd; when I try I get sudo: cd: command not found.

The way I found that worked was to log in as root on terminal and open/access the files that way. But it wasn't efficient; I still couldn't open the files via graphical file manager. Then I looked it up on many threads and only thing i found that worked was sudo chmod go+rx files but the problem with this is that it makes only the files folder accessible, not the subfolders, and if I try using the same command to the subfolders one by one it works but I've got hundreds of subfolders which also have subfolders in them.

So I'm asking if there's a more practical way of doing it.

Best Answer

Just add the -R option to recursively change all the permissions of each files and directories under a specified directory. An example, recursively add read and write permissions for the owner and group on foldername:

sudo chmod -R ug+rw foldername

Read more about permissions ...