4

I am trying to run a game on Wine, and for some reason after I run it one time, the files are locked after the first run and I can only open it using a Root account. I want to change ownership so that I can open the file with a regular account. I tried:

sudo chown -R Vince:evelauncher.sh

and I got this feedback:

chown: missing operand after ‘Vince:evelauncher.sh’ Try 'chown --help' for more information.

and of course the "help" menu wasn't much help lol

vince
  • 65
  • Others have already answered your question. I don't think you need the recursive -R option in this case, assuming evelauncher.sh is a file and not a directory containing other files. I would be careful of using -R option. Changing ownership of system folders and files can make a system unbootable. – user68186 Aug 31 '17 at 20:09
  • Thanks for pointing that out user68186. I'm not sure what I should use in place of R? ALso just FYI, the evelauncher.sh file is not the only file in that folder showing as locked. SHould I try again and use the R option, but change ownership of the whole folder instead of just the evelauncher.sh file? I should also ad that the game is running fine now with the command I used...although I have not tried rebooting. – vince Aug 31 '17 at 20:22
  • If it works let it be. Rebooting should not change anything. You may also give yourself (and others) permission to read, write, and execute the file without changing ownership. See https://askubuntu.com/questions/470831/change-permission-to-read-write-and-execute – user68186 Aug 31 '17 at 20:39

2 Answers2

2

The correct syntax of chown command is:

sudo chown user:group file

so you have to use it like:

sudo chown -R Vince:  evelauncher.sh

Pay attention to the space, by leaving the group section it will be automatically set to your primary group.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
  • 2
    you beat me by only a few seconds gosh darn thee. – Thomas Ward Aug 31 '17 at 20:04
  • Yep :D :D :D ... – Ravexina Aug 31 '17 at 20:05
  • It was a valiant effort Ravexin, I wish I could mark them both as the solution! It's amazing how little details like that make all the difference with code. Thanks! I'll try to be more detail oriented in the future:)...EDIT: wait I thought Thomas was first because he was showing on top. I changed the marked solution to the first responder – vince Aug 31 '17 at 20:15
  • @vince I'm Glad that it was helpful ;) – Ravexina Sep 01 '17 at 04:12
  • Just a minor correction: if you do USER: it assumes you want user and group to be the same. The extra space you added does nothing, and is unnecessary. – Thomas Ward Sep 01 '17 at 15:19
  • @ThomasWard I checked it again, when you use USER: it assumes that you want the USER's primary group, not a group with same name as USER. I used extra space to make sure the OP sees the different :-) – Ravexina Sep 01 '17 at 16:38
  • @Ravexina in 99% of cases the 'primary group' is the usergroup made for the user. – Thomas Ward Sep 01 '17 at 18:21
  • @ThomasWard Yeah, but I actually changed my primary group to something else to test it. Again file's group became my primary group which wasn't same as my username. – Ravexina Sep 01 '17 at 18:27
2

sudo chown -R Vince:evelauncher.sh is an incomplete command.

The proper usage of chown is as follows:

chown [options] USER[:GROUP] file

(in your command, -R for recursive is an option)

Your line does not put a space between the Vince: (user and group designator) and the file name, so it doesn't work. You need to use spaces such that you end up with this:

sudo chown -R Vince: evelauncher.sh
Thomas Ward
  • 74,764