Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to compile a program, and I need to modify the Makefile. However, I cannot modify the Makefile using emacs, because it keeps saying that the Makefile is READONLY. I have changed the permission using 'chmod 777 Makefile', but somehow this does not have an effect (the 'ls' command show that the Makefile is writable after I did the chmod).
Greetings,
Log in as root, check your user groups for your primary login id and add/subtract groups you need/don't need. Then check the ownership of the file, make sure you have access to it as main user. Log in as yourself and whack away.
Frosty man, thanks for your reply.
The file is owned by root, and even though I logged in as root, I am still unable to modify the file. I must have missed something here, it's kind of weird that I was able to play with the file permission but not able to modify it.
Also see if you can edit the file as root. File permissions should be irrelevant for root. If you're trying to rename, delete, copy or move the file then the directory permissions come in to play.
Another thing, could you post the ouput of ls -l for that file.
[root@localhost Release]# chmod 777 Makefile
[root@localhost Release]# ls -l
total 48
drwxrwx--- 2 3527 3527 4096 Apr 23 1993 bin
-r--r----- 1 3527 3527 161 Feb 4 1993 Bugs
drwxrwx--- 2 3527 3527 4096 Apr 23 1993 data
drwxrwx--- 2 3527 3527 4096 Jul 29 1993 doc
drwxrwx--- 20 3527 3527 4096 Mar 1 1993 examples
drwxrwx--- 2 3527 3527 4096 Feb 18 1993 help
-rwxrwxrwx 1 3527 3527 4267 Feb 19 1993 Makefile
-r--r----- 1 3527 3527 865 Feb 4 1993 README
drwxrwx--- 2 3527 3527 4096 Feb 18 1993 SCCS
drwxrwx--- 24 3527 3527 4096 Apr 23 1993 src
-rwxr-x--- 1 3527 3527 254 Feb 4 1993 suprem4gs
[root@localhost Release]# emacs Makefile
How do you find out if you can edit a file? It looks like the 'rwx' there for all owner, group, and others. I don't know why '3527' is there instead of 'root'. Does the way I un-tar the file matter?
Tar can keep permissions. So whatever permissions they tarred it with might be what you un-tar it with. It's weird that you can't change it even as root. The only thing I can think of is that a process is using it and hence blocking it. But why would that be for a makefile? I dunno. Something's definetly wrong when root can't edit a file because it's read only. You can try changing the ownership to root or whatever else. Though I can't imagine why that would help since permissions SHOULD be irrelevant for root. Weird. Have you tried deleting it and extracting it again?
Thanks for all the reply,
I've tried delete the file, even the tar-file, and download it again from the internet, still I was unable to edit. I've changed the ownership also, still didn't work. I'm just going to leave it alone for right now, and get back to it again later.
Hi all, it turned out that the problem I have was related to emacs. I used other text editor, and I was able to edit the file. Why does emacs prohibit me from editing? I don't know. Anybody knows?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.