pauljt
Posts: 1
Joined: Wed Apr 13, 2016 11:42 pm

linux command chmod

Wed Apr 13, 2016 11:46 pm

when I try to change permissions on the "etc" file I get the reply:
chmod: changing permissions of etc : operation not permitted

I need to add a line to the etc file to enable an add-on lcd screen

is it possible to change the permissions ?

Dutch_Master
Posts: 362
Joined: Sat Jul 27, 2013 11:36 am

Re: linux command chmod

Thu Apr 14, 2016 12:14 am

Use the sudo command. Read up on it with

Code: Select all

man sudo
HTH!

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: linux command chmod

Thu Apr 14, 2016 2:08 am

pauljt wrote:when I try to change permissions on the "etc" file I get the reply:
chmod: changing permissions of etc : operation not permitted

I need to add a line to the etc file to enable an add-on lcd screen

is it possible to change the permissions ?
Whoa there sundance... etc is a directory (folder) not a file. You don't edit /etc .

You might edit something in /etc like:

gksudo nano /etc/hosts

or

sudo vi /etc/hosts

This is /etc
drwxr-xr-x root root

The d :roll: above stands for 'directory' ... this says that root is the owner with read,write, execute permissions.

This is hosts:
-rw-r--r-- root root ... this says that root (the owner) has read,write permissions (the d is missing)

The hosts file is a 'file' the /etc entry is a 'directory'


(be careful editing system files until you know what you are doing... its dangerous)
marcus
:ugeek:

Heater
Posts: 14725
Joined: Tue Jul 17, 2012 3:02 pm

Re: linux command chmod

Thu Apr 14, 2016 5:21 am

Yes, unless you have very good reason it's a bad idea to go around changing permissions on system files on your Unix/Linux systems. That is pretty much anything not in your home directory.
Memory in C++ is a leaky abstraction .

Return to “Other programming languages”