Ubuntu complains that I am not "Owner" when copying files to certain folders

7,638

You copy the file using sudo

sudo cp file destination

For directories use th -R flag

sudo cp -R directory destination

If the files or directories have spaces, you have to quote or escape ( \ ) them

sudo cp "file with spaces" destination
sudo cp file\ with\ spaces destination

For information on Linux permissions and the use of sudo, see:

https://help.ubuntu.com/community/RootSudo

and

https://help.ubuntu.com/community/FilePermissions

Share:
7,638

Related videos on Youtube

jay_t55
Author by

jay_t55

Updated on September 18, 2022

Comments

  • jay_t55
    jay_t55 over 1 year

    I am trying to copy a folder into the user/share/themes folder on Ubuntu 14.04, and it's telling me I cannot do this because I am not "owner". So I right-clicked the usr/share/themes folder > Properties > Permissions tab and tried to change the permissions but they're all greyed-out/disabled.

    So then I opened up Terminal, entered groupmod TAB TAB TAB > sudo adduser jase root to try and get higher permissions or something - and it worked. I verified that I added myself as root by id jase. But that still didn't fix the problem. I still can't copy folders or files to usr/share/themes folder.

    How can I do this? How do I become "owner"?

  • jay_t55
    jay_t55 almost 10 years
    I just tried that. With: jase@Jase-PC:~$ sudo cp '/home/jase/Downloads/flattastic_13_01_2014_by_nale12-d70zd5‌​z' '/usr/share/themes' [sudo] password for jase: cp: omitting directory ‘/home/jase/Downloads/flattastic_13_01_2014_by_nale12-d70zd5‌​z’ but then it didn't work. It said: "that it omitted something."
  • jay_t55
    jay_t55 almost 10 years
    I'm sorry but the link above - none of that stuff works. I've tried it a dozen times. And I'm not that new to linux (I've just been away from Linux for a while). Anyway, I've managed to solve it by entering sudo chown -R jase /usr/share/themes into terminal. I remember doing that last year. It's working just fine now. Thanks for your help :)
  • Panther
    Panther almost 10 years
    That is not really a good idea (changing ownership and permissions of system files). You need the -R flag with cp for directories . cp -R directory destination. The error messages in Linux are (usually) helpful, if you do not understand them, post the command and error message.
  • Panther
    Panther almost 10 years
    That is not true, use the -R flag for directories. cp -R /home/jase/Downloads/flattastic /usr/share/themes/