Reputation: 2631
I have a file of which I need to change contents, that has these permissions:
-rw-r--r--
How do I find out which permissions group I belong to, so I can do a chmod command?
I just tried to do chmod and I got an error:
$ chmod 777 hosts
chmod: Unable to change file mode on hosts: Operation not permitted
Here is my ls -l
-rw-r--r-- 1 root wheel 313 Apr 16 13:04 hosts
Upvotes: 2
Views: 10324
Reputation: 1831
This is what solved my problem
Make sure you are the owner of the file go to the root file, right click then go to more info at the bottom you can set permissions, hit the plus sign to give your self read + write permissions after that hit the gear option and make yourself the owner
in the root file run
sudo chmod 777 *
if doing this in react native to start up your app run
sudo npm start
and you should be good to go
Upvotes: 0
Reputation: 2354
'ls -l' will tell you all you need to know.
Permissions Directories Group Size Date Directory or file
drwx------ 2 users 4096 Nov 2 19:51 mail/
If you have root permission, try a 'sudo chmod 777 hosts'.
Upvotes: 3
Reputation: 6968
If you have a super user's password you could always :
$ sudo chmod 777 hosts
which, of course, is never a very good idea.
Upvotes: 1
Reputation: 9200
the owner of the file will need to change permissions or change ownership by using chown,
here are some examples: http://en.wikipedia.org/wiki/Chown
Upvotes: 1