I am working in the most recent Ubuntu in a 64 bit machine. I am currently on the
Gnome command prompt and I am trying to move a file under the Downloads directory to /usr/local
. However, it gives me a permission denied message even though I typed in chmod 777 filename
and I am the administrator. What should I do?
Ubuntu – How to move a file to /usr/local in Ubuntu
directoryfilespermissionsUbuntu
Best Answer
Don't run
chmod 777
on anything! That will make it writable AND executable by anybody, and you realy don't want that. Trust me on this one and never do that. You don't want to be responsible for kittens dying, planets of foreign stars exploding and other destructive chaos. The only thing you ever need the7
for is the first digit, which means the owner of the file can write, edit and execute the file. The second digit is for the group owner, and in rare cases7
might be acceptable. For everybody else you should restrict the permissions to only what they need.If you knew the original permissions for the file, now would be a good time to change them back. If you don't here is how to figure it out:
755
so that you canrwx
, but everybody else can onlyrx
:$ chmod 755 filename
644
so that you canrw
and everybody else can only read:$ chmod 644 filename
Now about moving that file :) To move it to
/usr/bin
, you need to run the move command as the superuser. You may own the file in question but you don't own the directory you are moving it to so you don't have write permissions there. You can use the command 'sudo' to run a command with root permissions like this:This will likely prompt you for your user password.