7 ms·
> The oddly named wc is a command used to count things. It’s named after word count.
by saagarjha 9y ago
> The oddly named wc is a command used to count things.
It’s named after word count.
- AstralStorm 9y agoStill oddly named. Why isn't it called count or cnt?
- saagarjha 9y agoTo keep with the Unix tradition of short command names, I guess?
- LukeShu 9y ago`wc` was in 1st edition Unix. It was setting the tradition, not keeping with it!
- rotten 9y agoI suspect the ability to count things other than words was added later.
- Ensorceled 9y agowc shares an environment with grep, awk, sed and vi; wc is NOT oddly named.
- tpm 9y agoalso with at, bc, cd, cp, dd, df, du and so on
- pgl 9y agoI'm not sure about that - I think you could argue that they're all oddly named.
- Sir_Cmpwn 9y agoFor those interested in the etymology of these: grep is from the ed command (which itself is short for editor, the original Unix text editor) g/re/p, which Globally searches for a Regular Expression and Prints it. sed is Stream EDitor. vi is VIsual editor, which is so named because it's like ed but shows you what you're editing. Not sure where the name awk comes from. All of these tools are closely related to the venerable ed(1) command.
- lainga 9y agoalso - not pointing any fingers - I suspect for the same reason hexadecimal (which programmers shortened to hex) was used over the proper Latin sexadecimal.
- wodenokoto 9y agoAnd overlap with a common abbreviation that refers to a toilet, WC (water closet)[1] So yes, it has an odd name, and I'm sure the inventor of the wc command thought it funny. [1] https://en.wikipedia.org/wiki/Flush_toilet https://en.wikipedia.org/wiki/Flush_toilet
- Alex63 9y agoI wonder if the author might have thought it was an odd name because "wc" is also used in some English-speaking countries as an abbreviation for "water closet", a synonym for a flush toilet.