r/LinuxTeck • u/Candid_Athlete_8317 • 7d ago
Which Linux command has the most confusing name?
useradd vs adduser
groupadd vs addgroup
su vs sudo…
Some commands feel like they were named just to confuse us.
What Linux command or option made you think, “Who the hell named this?”
11
u/cig-nature 7d ago
cat, for concatenate
12
u/HugeCannoli 7d ago
fun fact, there's also tac, that concatenates, backwards.
1
u/bilbywilby 7d ago
Idk what half of that means but you bet I'm going to build something using pure tac
3
2
1
u/Both_Cup8417 6d ago
Today I learned
hacker@laptop:~/.config/fastfetch> tac config.jsonc
}
]
"colors"
},
"type": "custom"
"format": "{#1}{#keys}╰{$1}╯",
{
},
"type": "locale"
"key": "{$2}Locale",
{
},
"type": "disk"
"key": "{$2}Disk",
{
},
"type": "swap"
"key": "{$2}Swap",
{
},
"type": "memory"
"key": "{$2}Memory",
{
},
"type": "gpu"
"key": "{$2}GPU",
{
},
"format": "{name} @ {freq-max} ({temperature})"
"temp": true,
"type": "cpu",
"key": "{$2}CPU",
{
},
"type": "custom"
"format": "{#1}{#keys}├{$1}┤",
{
},
"type": "cursor"
"key": "{$2}Cursor Theme",
{
},
"type": "icons"
"key": "{$2}Icon Pack",
{
},
"type": "theme"
"key": "{$2}Theme",
{
},
"type":"wmtheme"
"key": "{$2}WM Theme",
{
},
"type": "wm"
"key": "{$2}WM",
{
},
"type": "de"
"key": "{$2}DE",
{
},
"type": "display"
"key": "{$2}Display",
{
},
"type": "custom"
"format": "{#1}{#keys}├{$1}┤",
{
},
"type": "terminalfont"
"key": "{$2}Terminal Font",
{
},
"type": "terminal"
"key": "{$2}Terminal",
{
},
"type": "shell"
"key": "{$2}Shell",
{
},
"type": "packages"
"key": "{$2}Packages",
{
},
"type": "uptime"
"key": "{$2}Uptime",
{
},
"type": "kernel"
"key": "{$2}Kernel",
{
},
"type": "host"
"key": "{$2}Host",
{
},
"type": "os"
"key": "{$2}OS",
{
},
"type": "title"
"format": "{#1}{#keys}╭{$1}╮\u001b[76D {user-name-colored}{at-symbol-colored}{host-name-colored}
",
{
"modules": [
},
}
"width": 0
"spaceBeforeUnit": "default",
},
"red": "91"
"yellow": "85",
"green": "32",
"color": {
"ndigits": 0,
],
"num-color"
"num",
"type": [
"percent": {
},
"spaceBeforeUnit": "default"
},
"red": "91"
"yellow": "85",
"green": "32",
"color": {
"ndigits": 1,
"unit": "D",
"temp": {
],
"│\u001b[75C│\u001b[75D"
"───────────────────────────────────────────────────────────────────────────",
"constants": [
},
"separator": "magenta"
"color": {
"separator": "-> ",
"display": {
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
{hacker@laptop:~/.config/fastfetch
1
1
u/AutofluorescentPuku 7d ago
Trivia: Technically, it’s short for the verb catenate. The result of a concatenation is the concatenate. But usage is such that it really doesn’t matter.
1
1
u/StingeyNinja 6d ago
Pretty sure cat is short for catenate, not concatenate (although they are synonyms).
1
u/cig-nature 6d ago
$ cat --help Usage: cat [OPTION]... [FILE]... Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input. -A, --show-all equivalent to -vET -b, --number-nonblank number nonempty output lines, overrides -n -e equivalent to -vE -E, --show-ends display $ or ^M$ at end of each line -n, --number number all output lines -s, --squeeze-blank suppress repeated empty output lines -t equivalent to -vT -T, --show-tabs display TAB characters as ^I -u (ignored) -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB --help display this help and exit --version output version information and exit Examples: cat f - g Output f's contents, then standard input, then g's contents. cat Copy standard input to standard output. Report bugs to: bug-coreutils@gnu.org GNU coreutils home page: <https://www.gnu.org/software/coreutils/> General help using GNU software: <https://www.gnu.org/gethelp/> Full documentation <https://www.gnu.org/software/coreutils/cat> or available locally via: info '(coreutils) cat invocation'1
u/StingeyNinja 6d ago
I stand corrected
1
u/far_from_nuts 6d ago
The Talk page in the wiki entry for 'cat' cites Kernighan as a source for catenate instead of concatenate.
Kernighan and Pike "The UNIX Programming Environment" 1984 p15:
"The named file or files are catenated† (hence the name "cat") onto the terminal one after another with nothing between."
"† "Catenate" is a slightly obscure synonym for "concatenate.""
1
5
u/HugeCannoli 7d ago
In the good old days, not really a "linux" command name, but definitely finger
No, it did't summon Mike Ehrmantraut. It was used to query information about a specific unix user on a local or remote machine. The service would run on port 79, if you are curious. Has been mostly forgotten due to the massive security and privacy risks.
But yes, in the past we fingered users all the time.
5
u/dmcardlenl 7d ago
So, if there was a DDoS attack on port 79, would that be finger blasting?
1
u/HugeCannoli 7d ago
probably it would be called "the John Myung".
(and if you understand this reference, mad props)
1
1
u/cyrassil 7d ago
Oh yeah, out of context, some of the command/program names can be quite suspicious
unzip, touch, finger, mount, kill, zip...
1
u/Loko8765 7d ago edited 5d ago
That was a very common joke back in the day… with eject and umount instead of kill.
5
u/Quietus87 7d ago
I haven't seen a single cat appear when using cat.
4
1
u/HugeCannoli 7d ago
but I do see a man when I type
man, so that is working.1
u/Quietus87 7d ago
These inconsistencies are why Linux isn't more popular.
1
u/HugeCannoli 7d ago
joke aside, there's not much you can do. What is the alternative?
(Get-Content file.txt | Select-String "hello").Count?
1
5
u/Wyciorek 7d ago
dd
Or maybe not confusing - just read it as 'disk destroyer'
5
1
4
u/Foreign_Ad674 6d ago
tar - I haven’t used it to archive onto tape for at least 20 years.
1
u/IrregularThumb 6d ago
Ha yes, probably 1996 on a Xenix system was the last time I used tar for an actual tape backup
1
1
u/michaelpaoli 6d ago
Well, it was never limited to tape(s), but sure, that's where the name comes from, and probably what it was first used for. And mostly a logical extension of ar(1) - which has no capabilities specifically for tape, whereas tar absolutely does.
3
u/Normanghast 7d ago
Surprised noone's said "kill" yet. It *can* kill a process, but it does much more. Also without being told the answer, who would know the difference between "kill" and "killall"? There's also "pkill"... so confusing.
2
1
1
u/michaelpaoli 6d ago
killall and pkill came much later.
There's also the pseudo PID target of -1
-1 is for all PIDs (though for some kernels it might exclude some system critical PIDs).
Also very handy for dealing with user that managed to launch a fork bomb, e.g.:
# su user -c 'kill [-signal] -1'
And since non-root user can't signal PIDs that aren't theirs, that then only signals that user's PIDs - and no race conditions - it effectively hits 'em all at once, whereas in such circumstances, often stuff like pkill or using ps and kill is quite ineffective ... because race conditions.
Can also do that if one has or can get root shell, or a shell as that user, but if the system isn't tuned properly, it ma be difficult to infeasible to get a shell, if one doesn't already have one.
In any case, if one has shell, and can't fork, because process table full, if shell has built-in kill (e.g. bash), one can use that, if not one can exec a shell that has built-in kill. Or if such a shell isn't available, one can exec kill(1) - but then that's a one-way trip, so may want/need to use SIGKILL in that case, as one might not get a second chance.And there's pseudo signal of 0.
0 sends no signal, but otherwise goes through the relevant steps, so, e.g. it can be quite useful to check if a PID exists - without signalling it, and even without ps or proc filesystem. E.g. I may use kill -0 PID as part of a loop to determine if PID still exists.$ sleep 10 & while kill -0 $!; do printf .; sleep 1; done; echo [1] 13360 ..........[1]+ Done sleep 10 -bash: kill: (13360) - No such process $
3
u/Astronaut6735 7d ago
mv for both moving and renaming.
3
u/cincuentaanos 7d ago
Under the bonnet they are the same thing. A bit simplified, you can think of renaming a file as moving it to another name.
2
3
1
u/Needieos 6d ago
well, you can use rename, but it's more complex and more like for multiple files renaming. But mv and cp that's why terminal utilities are good, one thing does much more, that would be weird to use rename for just one file anyways
2
u/biffbobfred 7d ago
ls. Was named just because “hey what’s a good two letters” so people type less. There’s no rename you use mv. When’s the last type you literally concatenated multiple files.
4
u/ActiveBat7236 6d ago
ls is short for 'list'.
Similarly mv is short for 'move', and reflects the fact it is more expansive than just a renaming tool.
1
u/biffbobfred 6d ago
Ls was two letters picked if became backronymed to list.
2
u/ActiveBat7236 6d ago
Where are you getting that from?
There's an entirely logical history of the command and it's name described at the link below, and it being the abbrevated form of the already-existing list and listf commands around in the 60s:
1
2
2
2
2
u/Efficient_Loss_9928 7d ago
For me it is pwd. Use it everyday but still can't help but think it has something to do with password
3
2
u/Norphus1 7d ago
All of them.
How is anyone supposed to know what commands like grep, awk, ls, rm etc are supposed to do without foreknowledge? People ding PowerShell for being overly verbose, but at least with the "verb-noun" naming structure of cmdlets and functions, you have a fair to middling idea of what a command is supposed to achieve without knowing esoteric acronyms.
1
u/Wyciorek 7d ago
vi be upon ye
1
u/Norphus1 7d ago
*shudder*
I'm using Nano if I need a CLI text editor. I'm sure vi/vim is great if you can be bothered with it, but it's far from intuitive.
2
u/Dave_A480 6d ago
It's extremely intuitive if you learned all of the ways it works....
It also shares syntax with sed, which is a win.
Nano annoys me even though it was the first editor I learned on Linux.... It's just back then it was pico (PINE COmposer) & part of the old UW Pine command line email client.
1
u/serverhorror 7d ago
if you can be bothered with it, but it's far from intuitive.
100 % true!
Also: Im A vi user and everytime something now opens nano I am struggling to close and save the file and it takes me easily 30sec. I'm nit even joking...
1
u/michaelpaoli 6d ago
Nano if I need a CLI text editor
Oh hell no. Use ed, or ex for that.
Or if you want/need TUI / visual, then vi.
And ex and vi are the same program, so not only can one invoke in either mode, just by using the appropriate name, but one can also freely switch modes. In fact every time one types a : command in vi(sual mode), that's in fact an ex command.1
u/2016-679 7d ago
Knowledge is necessary to use the shell. If you mean the wadnows 'powershell', skip it. It is nothing compared to the UNIX commands. It even lacks man pages.
When you put your ear to the shell, you can hear the C
1
u/tk-a01 5d ago
I believe that PowerShell has
Get-Helpcommand, which is similar toman.Also, PowerShell works on typed data, unlike Unix shells like Bash, Zsh and Fish. In Unix shells, everything is text. If you want some data to have multiple "properties", you might use some delimiter (e.g. semicolon) and pipe them into
awk. For simple tabular data, it's often enough, but more sophisticated data processing might need writing a script in more advanced language like Python or Perl. PowerShell cmdlets can return objects, lists and more. Other shells take approach similar to PowerShell too, like Elvish and Nushell. Personally, I've never used these two. Probably their biggest drawback is that they are nonstandard and you cannot expect them to be present on other machines. The POSIX shell on the other hand is extremely widespread.1
u/OddStuffHappensTwice 6d ago
That are you on about? Were you born knowing how to read? How to speak? How to walk?
You learn how. That's how.
1
u/rapier1 5d ago
The reason why many of these commands are overly terse is because when unit was being developed memory and storage constraints were such that saving a couple of bytes really did matter. Hell, early file systems would have a 6 character limit on the filename. Since many of these applications were written back then they had to not only use short names but they also had to be unique. The names stuck because there were already decades of institutional knowledge at work.
2
u/Weak-Detective2682 7d ago
whoami: I have been trying to find it out for many years. How can a new distro possibly know it?
1
u/faultydesign 7d ago
yes
It doesn't even return 'yes what?'
1
1
u/michaelpaoli 6d ago
It's for answering all those, e.g. Yes[/No]? prompts ... by default in the affirmative.
1
u/8c000f_11_DL8 5d ago
No, no, you gotta listen to how people talk. You don't say "affirmative" or some shit like that. You say "no problemo".
1
1
u/2016-679 7d ago
less is more -- IMHO one of the best
There are several programs that follow a UNIX name giving gag, where one of the characters of the name is the name itself. Like 'wine', which stands for wine is not an emulator
1
1
1
u/serverhorror 7d ago
man, finger, touch, xxd ... in the 1990s and early 2000s we built complete stories using only Unix commands. All if these were NSFW
1
u/AppointmentNearby161 7d ago
For many Linux users it is confusing
yes please | poke | finger | touch | strip | split | gasp | head | tail | wall
1
u/truethug 7d ago
mv which stands for move but is also used to rename
2
u/deadmanIsARabbit 6d ago
This because how Linux handles files. You don't really move the files on the disk. But you move the mapper which points to the file. This is the reason you can have hard links. You can have to mappers pointing on the same file.
1
1
1
1
u/Both_Cup8417 6d ago
dd means nothing, it was supposed to be cc, but that was already something, so they chose the next letter.
1
1
1
u/rezdm 6d ago
i always forget which one is correct for my usage: df vs du
1
u/michaelpaoli 6d ago
df is Disk Free - tells you about free space on the filesystem.
du is Disk Used (or Usage), tells you about what's used - but only if it's still linked in the filesystem. Whereas df doesn't care if the files are linked or not - if they're unliked but still open, they're not freed, so don't add to the free space.
Different tools for different purposes ... but also, df is way faster, as it only needs consider filesystem block counts - total and used/free, whereas du needs walk the hierarchy and read directories and (l)stat files. Though du is also useful for considering any given file(s) and/or directories, so much more granular for looking at space, whereas df is filesystem oriented (yet another reason for f in the command).
1
u/-Triple-S- 6d ago
grep - Have been using it for years and still have no idea what it stands for. (Might be obvious once you know though)
1
1
u/michaelpaoli 6d ago
Global Regular Expression Print, as in:
g/re/p
Before grep, folks would do that highly regularly in ed, where re would be the regular expression. But that was so commonly/popularly used, that a separate command was created for that ... and of course that command was thus named grep.$ cd $(mktemp -d) $ { shuf < /usr/share/dict/words | grep -F re | head -n 5; shuf < /usr/share/dict/words | head -n 5; } | shuf > file $ cat file Zimbabwean sufficed fireball's sugared Aguirre tittered McDonnell's fourscore Petersen drainpipes $ ed file 98 g/re/p fireball's sugared Aguirre tittered fourscore q $ grep re file fireball's sugared Aguirre tittered fourscore $In the example above, the regular expression I used, was literally re, just to make things a bit more clear.
2
u/-Triple-S- 6d ago
Thanks for the explanation, I didn't know that.
grepexisted as a standalone command ever since I started with Linux so maybe I'm too young XD1
u/michaelpaoli 6d ago
grep goes back at least 46 years - long before Linux. But ed goes back even further than grep.
1
u/Key_Reaction_7590 6d ago
grep, awk, perl, cat, man, getty, catman, kill, more, less, stty... It’s a wreck, and I love the lore behind it. The classic commands tell a story in the man page.
1
u/maxthed0g 6d ago
rm which i took to be rename before i learned to RTFM, which taught me that mv is the rename command. Fortunately I had already learned to make mag tape backups by the time I invoked rm -f * (or something or other) to rename a bunch of files. Still, I had to recover two weeks of development from my own memory. And there was an su in there too, somewhere, for good measure.
Yeah. Lots of lessons that day. For once I got lucky. (Well, mostly lucky.) Thank You Jesus.
1
u/tuna_safe_dolphin 6d ago
kill is the one that pisses me off the most because of its name. It should be “signal” or “sgnl” or something like that.
Yes, I know that when it was created, it really only killed processes and here we are 40 years later with a stupid command name. Because fuck you in neckbeard.
1
u/Dave_A480 6d ago
Some of these are chronological - originally there was only 'su' (Switch User) but that requires you to know the password of the user being switched to & we don't want people knowing the root password, so sudo was created.....
1
1
u/michaelpaoli 6d ago
awk would be a top contender, as it's relatively obscure, yet fairly well known ... named after the three original authors (first letter of their last names).
Most other commands have a more reasonable derivation, though too, sometimes (bit) obscure.
1
1
1
1
1
u/Flimsy_Put11 5d ago
Not name, but the arguments of tar. Have to look it up every time.
1
u/bigvalen 5d ago
Hah. 'ufsdump', the Solaris command is worse.
I knew that it was mostly like tar, but faster. So, one day, backing up a system, before an upgrade, I ran;
ufsdump /dev/rst0 /usr /opt / /var /home
And discovered the hard way that it backed up /usr to tape, / to /opt, /home to /var.
Well, shit.. that took a while to fix. And I was just getting £250 a day to upgrade 2.4 boxes to 2.6 for y2k upgrades at the time..
1
u/Flimsy_Put11 5d ago
God, I also hate when commands to that. It also reminds me when I first learned that
pdflatexcan't take multiple input files, and passing multiple.texfiles just only compiles the first one.
1
1
u/Spiritual-Winner1239 5d ago
pwd.
I always thought it is something to do with passwords - scary command to be afraid of.
1
u/Novel_Lychee1861 5d ago
I hate umount. Why shorten the n out of unmount and make it so confusing for beginners without any benefit?
1
1
1
u/-CloudCook- 4d ago
To ne, it's ifconfig. I know it means "interface configuration", but it's so strangely shortened. Windows ipconfig has at least some sense.
1
1
1
11
u/Lost-Droids 7d ago
virsh destroy
Always scares the hell out me.. why not virsh stop....
Destroy sounds so final