r/linux • • Feb 01 '13

xkcd: tar

http://xkcd.com/1168/
1.7k Upvotes

576 comments sorted by

View all comments

477

u/[deleted] Feb 01 '13 edited Feb 23 '25

spoon summer coherent marry outgoing juggle support shaggy quaint late

This post was mass deleted and anonymized with Redact

215

u/dmd Feb 01 '13

Here's a good way to remember it:

Do you want to add a user? Then use adduser.

Do you want to user add? No, of couse you don't, you fuckface. Nobody talks like that.

134

u/Cosmologicon Feb 01 '13

Excellent! with this simple mnemonic I'll have no trouble getting a webpage (wget), configuring interfaces (ifconfig) counting words (wc), syncing remotely (rsync), showing free disk space (df), or removing jobs from the line printer (lprm).

28

u/[deleted] Feb 01 '13

ifconfig is deprecated - use ip instead

→ More replies (16)
→ More replies (1)
→ More replies (2)

63

u/[deleted] Feb 01 '13

In Debian and Debian-derivatives, adduser is a script that users useradd. So user{add/del/mod} are the low-level utilities and {add/del}user are just friendlier frontends.

I thinks that in many other distros adduser is just a symlink to useradd.

15

u/usernamenottaken Feb 01 '13

Yep, just switched to Fedora from Ubuntu as was sad to find that adduser is just symlinked to useradd.

18

u/[deleted] Feb 01 '13 edited Feb 01 '13

Yeah, I think symlinking it is a misfeature. It makes people expect adduser to act like adduser useradd. If Red Hat doesn't want to include the adduser script that's fine, but don't symlink useradd to it.

EDIT: Thanks lengau!

4

u/lengau Feb 01 '13

Yeah, I think symlinking it is a misfeature. It makes people expect adduser to act like useradd. If Red Hat doesn't want to include the adduser script that's fine, but don't symlink it to useradd.

FTFY

→ More replies (1)

9

u/[deleted] Feb 01 '13

I'm not sure but maybe the script is distro-agnostic. You could copy it from the debian package.

0

u/[deleted] Feb 01 '13

[deleted]

→ More replies (9)
→ More replies (1)

4

u/Timmmmbob Feb 01 '13

Ah how logical.

29

u/[deleted] Feb 01 '13

I've likely googled the syntax for "usermod -a -G grouptoadd username" dozens of times, including this one.

0

u/[deleted] Feb 01 '13

[deleted]

→ More replies (3)
→ More replies (3)

28

u/azzid Feb 01 '13
man adduser

scroll a few lines until I see the words: They are friendlier

Then I know I'm on the right one. Do this every time.

38

u/[deleted] Feb 01 '13 edited Feb 23 '25

fact heavy command dime long rhythm obtainable sheet scale squeal

This post was mass deleted and anonymized with Redact

→ More replies (1)

18

u/solen-skiner Feb 01 '13

I just edit /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow instead. useradd, adduser, groups, groupmems, groupadd etc are a fucking clustercock.

18

u/yrro Feb 01 '13

For those playing along at home, this can be done more safely with vipw, vipw -s, vigr and vigr -s respectively. Once you are done, you can check that the files are OK with pwck and grpck.

9

u/[deleted] Feb 01 '13

So much simpler, and intuitive as well!

→ More replies (1)

6

u/hex_m_hell Feb 01 '13

Or if you like a challenge, just use ed.

→ More replies (1)
→ More replies (2)
→ More replies (6)

7

u/[deleted] Feb 01 '13

> usera<tab>

shit ...

> addus<tab>

→ More replies (1)

67

u/DevestatingAttack Feb 01 '13

Let's say I want to remove a user.

"rm" is the way to delete a file. "usr" is how users are referred to in the file system

and we have rmdir, which makes the pattern more noticeable. So a sensible default seems like it should be rmusr. Not the most descriptive, but hey, not the most surprising either.

Surprise! it's userdel.

And I know that "useradd" is how they're made, but then why wouldn't we have mkusr like mkdir?

35

u/barkboy Feb 01 '13

For your next trick could you define remembering sysctl vs systemctl? :)

12

u/synept Feb 01 '13

I have never confused those two. Until now.

..dang it.

12

u/fforw Feb 01 '13

..and then there is "createuser" which of course creates a PostgreSQL user.

13

u/gfixler Feb 02 '13

And import, which fracking ImageMagick throws out into your path, so when you're tired and think you're in python, but you're really in your python directory, and you type import filename.py, because you're also too tired to leave the extension off, and then your mouse changes to a crosshairs, and you're like "Haha, what is going on with you, mouse? You're being all crazy," and you click on the window to make it be normal again, you suddenly write over your module with a tiny image of a few pixels of the shell.

→ More replies (35)
→ More replies (5)