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.
After installing Wine I only had normal fonts in the programs I ran with Wine when I logged in as root. Logged in as myself I got those horrible squares.
Thinking that this could be because the fonts couldn't be reached when logged in as user, I decided to give everyone permission to read from /usr/ (I am the only person using the laptop anyway so I figured 'nothing to lose'). So,
chmod a+r -R /usr/
NOT a good idea :-( Everything on my desktop disappeared!!
Why was this so bad?? Reading doesn't hurt? Or....?
(1) "a+r" as a chmod argument? I personally don't like that style. I use exclusively octal when specifying the permissions that I give to chmod. There is no misunderstanding with octal. I encourage you to learn and use it.
(2) -R means recursive, which means that you altered the permissions of not only /usr itself but every file and every directory in /usr. Personally, I like to chmod only what I have in my sights, so to speek, the only exception being a collection of user data (e.g. a bunch of text files that I just copied over from a CDROM to a working directory on the hard drive) that I just acquired, that is currently in one specific harmless and out of the way spot and that needs to be altered as a unit. Especially, if I am root and I am working on the system, I will only change one item at a time and check things out after each change. It could be that, when you gave everything in /usr read permission to everyone, it was your system's security mechanisms that caused your problem, but that is a guess on my part. Obviously, you did create a problem.
chmod a+r <filename> is the relative form of the command. It means "grant read permission to all users on this file in addition to whatever other permissions are set". Similarly, chmod g-w <filename> would mean "remove write permission to all users in the same group on this file in addition to whatever other permissions are set".
The absolute octal form of the command is good, but I find this easier than working out the octal representations of the binary.
Dunno why this made everything on your [ljsbrokken] desktop disappear though.
Binary to octal is a lead pipe cinch. Each group of 3 bits of the 9 bit permission that you want to give, beginning with the left 3 bits, gets replaced by whatever single octal digit that those 3 bits correspond to. Binary to octal mapping is as follows:
Thanks (genuinely). I used to hack in machine code on my old Archimedes, so I'm quite familiar with binary and hex (and therefore octal too). My understanding is not the problem. My problem is laziness - I just can't be bothered to remember whether read permission is bit 0 or 2, and whether the user's permissions is the most significant nibble or whether that's all users, and I also can't be bothered to remember eight conversions from binary to octal (or decimal or hex - 'tis after all the same from 0 to 7!).
I can't stress enough - this is all my fault, pure laziness and no other reason. If I had to execute chmod commands frequently, I'm sure I'd remember, but I don't so I don't.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.