4 ms·
How, after like 20 years goofing around on linux, have I never heard of `w` ?
by gyrgtyn 9y ago
How, after like 20 years goofing around on linux, have I never heard of `w` ?
- sah2ed 9y agoSame here, although I'm only 14 years in.
- icedchai 9y agoYou're both newbs. ;) My first Linux box ran kernel 0.99.10.
- spudlyo 9y agoDo you know about `comm`? Given two sorted files it will show you in three columns. * unique lines to file1 * unique lines to file2 * lines common to both files You can pass it various options to suppress any of the three columns. I once had an interview at Facebook where one of the problems was easily solved by `comm`. I found it funny that the interviewer, or anyone who reviewed the interview question, had never heard of it. I was a good sport about it though, I ended up writing a janky Perl script that roughly implemented `comm` to solve the problem, which (modulo Perl) was what they wanted me to do.
- gyrgtyn 9y ago`comm` at least sounds vaguely familiar. Thanks for reminding me; looks useful.
- theoh 9y agoIn that vein, I was asked about implementing n-way merge of logfiles in an interview once. The key insight/recollection they wanted was: use a heap to implement a priority queue. Not sure it was a great question as jumping to employ a data structure like that might suggest premature optimization.
- drinchev 9y agoI remember I used `w` to check if someone is in the box and then use `talk` to open a chat with that user.
- mrb 9y agoOne time I briefly looked at the man pages of all the binaries under /{bin,sbin} /usr/{bin,sbin} that I didn't know about. A basic Debian install has only 555 binaries (https://pastebin.com/raw/VnrqDdq0 https://pastebin.com/raw/VnrqDdq0). Maybe 100-200 are new to you and are worth checking out. Do it.
- js2 9y agoThis is a good strategy. I grew up on SunOS before Linux. It had (has?) a fantastic set of man pages. You could start with "man intro" and go from there. Looks like it still leads you to the "1M System Administration" section: https://docs.oracle.com/cd/E19683-01/816-0211/6m6nc66m6/index.html https://docs.oracle.com/cd/E19683-01/816-0211/6m6nc66m6/inde... The Linux intro man pages are still pretty useless sadly.
- sireat 9y agoI remember 'w' from reading Cuckoo's Egg some 25+ years ago as a teenager. https://en.wikipedia.org/wiki/The_Cuckoo%27s_Egg https://en.wikipedia.org/wiki/The_Cuckoo%27s_Egg I still do it instinctively on my own boxes.
- scott_s 9y agoI thought the same thing. I usually do `who`, `top` and `uptime`. But `w` is far better than `who`.