vi
linuxmemes
Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
- Instance-wide TOS: https://legal.lemmy.world/tos/
- Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
- Understand the difference between a joke and an insult.
- Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
- Don't get baited into back-and-forth insults. We are not animals.
- Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
- Bigotry will not be tolerated.
3. Post Linux-related content
- Including Unix and BSD.
- Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of
sudo
in Windows. - No porn, no politics, no trolling or ragebaiting.
4. No recent reposts
- Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
5. π¬π§ Language/ΡΠ·ΡΠΊ/Sprache
- This is primarily an English-speaking community. π¬π§π¦πΊπΊπΈ
- Comments written in other languages are allowed.
- The substance of a post should be comprehensible for people who only speak English.
- Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
6. (NEW!) Regarding public figures
We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations. - Keep discussions polite and free of disparagement.
- We are never in possession of all of the facts. Defamatory comments will not be tolerated.
- Discussions that get too heated will be locked and offending comments removed. Β
Please report posts and comments that break these rules!
Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.
Getting flashbacks of me trying to explain to a mac user why using sudo "to make it work" is why he had a growing problem of needing to use sudo... (more and more files owned by root in his home folder).
Sounds like a problem fixing itself, at some point MacOS is going to have problems if it can't edit a config is my guess.
sudo dolphin
Then I act like a Windows user and go there via the GUI because I didn't feel like learning how to use nano.
Does it let you do that?
Also it may fail to connect to the compositor
If you're running dolphin as sudo and open like a text file in an editor, does it edit the file with sudo?
When you run a process under sudo
, it will be running as the root user. Processes that that process launches will also be running as the root user; new processes run as the same user as their parent process.
So internally, no, it won't result in another invocation of sudo
. But those processes a dolphin process running as root starts will be running as the root user, same as if you had individually invoked them via sudo
.
But in my experience Dolphin refuses to run via sudo anyway.
This is definitely the way for configuration files that you shouldn't change permissions or ownership on but only want to modify a few times.
However, I find chmod easier to use without reference by using the ugoa (+/-) rwxXst syntax rather than the numbers.
You meant sudo vim, ok?
(disclaimer: joke. Let the unholy war start)
I think you mean sudoedit file
eww.
neovim is better.
LOL, gtfo with that nonsense!
Do people really war over nano vs vi?
I get the vi vs emacs war, but are people really willing to die on a hill over nano?
why tho?
If it's a file I have to modify once why would I run:
sudo chmod 774 file.conf
sudo chown myuser:myuser file.conf
vi file.conf
sudo chown root:root file.conf
sudo chmod 644 file.conf
instead of:
sudo vi file.conf
Inane. Intentionally convoluted, or someone following the absolute worst tutorials without bothering to understand anything about what they're reading.
I have questions:
- Why are your configurations world readable?
- Why are you setting the executable bit on a .conf file?
- Why change the files group alongside the owner when you've just given the owner rxw and you're going to set it back?
- If it was 644 before, why 774?
- Why even change the mode if you're going to change the ownership?
- Why do you want roots vimrc instead of your users
- Why do you hate sudoedit
- Why go out of your way to make this appear more convoluted than it actually is?
Even jokey comments can lead to people copying bad habits if it's not clear they're jokes.
This was a joke right? I was baited by your trolling?
Anger, rage and ultimately hate
These are the emotions we feel sometimes
I felt kinda bad doing that at first. then your absolute rage made my doubt's melt away.
If your file is not in your home directory, you shouldn't do chmod or chown in any other file
What if I make my home /
If itβs all my system should I really care about chown and chmod? Is the point that automatic processes with user names like www-data have to make edits, and need permission to do so, and thatβs it?
Newish Linux user btw
In addition to corsicanguppy's comment, some β often important β programs actually expect the system to be secured in a particular way and will refuse to function if things don't look right.
Now, you'd be right to expect that closing down permissions too tightly could break a system, but people have actually broken their systems by setting permissions too openly on the wrong things as well.
That said, for general, everyday use, those commands don't need to be used much, and there might even be a way to do what they do from your chosen GUI. Even so, it nice to know they're there and what they do for those rare occasions when they might be needed.
Short answer: yes.
One of the tenets of security is that a user or process should have only enough access to do what it needs, and then no more. So your web server, your user account, to your mail server, should have exactly what they need, and usually that's been intricately planned by the distro.
If you subvert it you could be writing files as root that www-data now can't read or write. This kind of error is sometimes obvious and sometimes very subtle.
Especially if you're new to this different access model, tread carefully.
Great news! If you mess it up, many distros are really great at allowing you to compare permissions and reset them. The bad news is that maybe you're not on one of those. But you could be okay.
Thanks for the explanation!
I'm not sure if that's the joke and it flew over my head but isn't editing with sudo what you should be doing anyway if it's a system level file? You shouldn't change permissions unless the file is actually supposed to be owned by your user.
Sorry, user babe is not in the sudoers file. This incident will be reported
All incidents are reported directly to Stallman.
Torvalds would like to have a word with you
I don't think Torvalds wants to receive any reports.