I just missclicked w in terminal and… discovered new command?
Posted by Mister_Magister@reddit | linux | View on Reddit | 89 comments
```
w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1,
5, and 15 minutes.
```
Interesting!
noisyboy@reddit
There is also write and wall - the former allows you to send a message to another user's terminal and wall allows you to do the same to ALL logged in users. Combined with banner, you could have some fun (or get into trouble).
gt40mkii@reddit
Salivala@reddit
For the w
hubbardg2035@reddit
No bc my cat discovered this for me yesterday
SpaceCadet2000@reddit
New? That's ancient Unix magic.
Even our old AIX boxes back in the 1990s had that.
Mister_Magister@reddit (OP)
not new as in it is new but new as in I wasn't aware of it. Basic english. Calm your ego
SpaceCadet2000@reddit
Take your own advice friend.
moopet@reddit
My first experience with SunOS was like that. I tried all sorts of 1-, 2- and 3-letter combinations until I discovered "man", and then someone told me I could look in the bin directory to find other commands. Then I was off to the races.
negval@reddit
My cat does it all the time.
omenosdev@reddit
Tools with similar default status dumps, not overall functionality:
ShakaUVM@reddit
Also whoami
And who am i
Ruiz_Francisco@reddit
They type these commands in the beginning of Tron 2
rednets@reddit
See also:
last
: https://man7.org/linux/man-pages/man1/last.1.htmlpancakeQueue@reddit
Last is sorted by most recent login in descending order. So to get the most recent users only I always have to go
last | head
omenosdev@reddit
Only issue with
last
is needing elevated privileges to run (at least on the distros I've used).rednets@reddit
Hmm, it works fine for me as a normal user on Fedora and Ubuntu. /var/log/wtmp seems to be globally readable on both.
gre4ka148@reddit
also works for me on arch, normal user
nickram81@reddit
Why is systemd so fucking weird?
omenosdev@reddit
How so? Running any of those three commands without any extra arguments produce similarly tailored information.
loginctl
, as its name suggests, can actually manage user sessions.I wouldn't describe systemd as weird, it's often straightforward. Some of its commands produce output resembling or including information of existing tools which helps in transitioning, but ties them into to a larger unified system management infrastructure.
JDGumby@reddit
Not really. Quite a different format for each
gmes78@reddit
loginctl
is the command line interface tologind
. This is consistent across pretty much every single systemd tool.pugmilamber@reddit
you should also try: pinky
it is the updated alternative to the venerable finger you used to be able to type "finger me" on linux distros and get information about yourself . . . i'm pretty sure that went away the year of the linux desktop (the first one)
Own_Ad2169@reddit
I fingered myself and it shows that I have no plan and no mail.
pancakeQueue@reddit
pinky -l
will show the .project and .plan files if users on a multi user system have them. Fun place to put Easter eggs.SuAlfons@reddit
"the first one", laughed way too hard at this 🤣
paulodelgado@reddit
I remember going through each letter of the alphabet and hitting to figure out all the commands by that letter... then doing "man "... ah those were the days.
DividedContinuity@reddit
I was happy the day i discovered compgen -c
agentrnge@reddit
I was unpleased when I found out that on Cisco and other IOS-like devices that w is shorthand for write running config to storage. Was habit to do when logging into a system at start of troubleshooting to check load/users. Womo womp. Lol
Mister_Magister@reddit (OP)
I love that normal people would think "iOS? Like the apple os?" and you mean IOS the cisco os on the switches/routers xd
Savafan1@reddit
I remember using that 30 plus years ago on servers in college to see who was logged in. I don’t think I’ve used it recently though.
laminarflowca@reddit
In the good old days we could finger people too. Even at other institutions. I remember remote fingering some of my friends.
lelddit97@reddit
thats how you know the male to female ratio back then was approaching infinity
blackmesaind@reddit
You trying to say we weren’t fingering dudes back then? I know that’s not true..
mrtruthiness@reddit
Yes. I was trying to find my sister's e-mail address back in the mid-80's and was using that command. She had recently started work for Sandia National Labs. Security at Sandia let me know that I should stop what I was doing.
roelschroeven@reddit
When you fingered someone, you didn't just see whether someone was logged in, but you could also see the contents of a file named .plan that each user could create.
John Carmack used that to keep a kind of blog (before the name blog even existed). You could finger him and find out his latest piece about coding.
Good old days indeed.
Or you could finger an organization instead of a person (say @idsoftware.com instead of johnc@idsoftware.com) and get a list of usernames. Unthinkable these days.
TheCrustyCurmudgeon@reddit
Ahhh.. the memories...
Journeyj012@reddit
Aw gee, sounds like you love fingering
StochasticCalc@reddit
Uhh
adrianmonk@reddit
That and
who
and the even more amazingrwho
which showed who was logged in on every machine on the network.biffbobfred@reddit
Same. Solaris.
ChocolateDonut36@reddit
I accidentally typed
sl
and a choo choo appearedGositi@reddit
Yeah that one's good
natermer@reddit
Have you figured out what 'wall' is for?
IntergalacticLaxativ@reddit
Have you seen the left bracket "[" command?
# ls -l /usr/bin/[
-rwxr-xr-x. 1 root root 45056 Jul 7 17:00 '/usr/bin/['
deux3xmachina@reddit
That's because
if [ -x /bin/bash ]; then echo found it; fi
isn't purely shell syntax. It's evaluating the return code oftest
in theif
condition. It's the same as writingtest -x /bin/bash && echo found it
, wheretest/[
ignores the last argument if it's]
.Definitely surprising when you first discover it.
PM_ME_BONER@reddit
It actually is pure shell syntax today in any POSIX shell.
test
is a builtin since a long, long time.cathexis08@reddit
It's still technically required by posix to exist as a stand-alone binary in addition to the built-in which is always a bit surprising. So is cd though at least in the case of test it's actually useful.
IntergalacticLaxativ@reddit
Yeah. When I removed it I was a young and learning sysadmin on a VAX 11-750 running 4.2 BSD. It truly broke a lot of stuff. Ahh good times, good times.
FromTheThumb@reddit
It's a hard link to the test command.
bubblegumpuma@reddit
On most systems I've used nowadays where it isn't a shell builtin it's a symlink to
test
- there's a clue for anyone wondering what this is about :)OptimalSide@reddit
Use it all the time professionally as its way shorter than typing out uptime
djphazer@reddit
Literally the first thing I type every time I log in to my home server
OptimalSide@reddit
Why not add it to your .bashrc so you get it every time you log in...
carlwgeorge@reddit
Same exact reason it became muscle memory for me.
cloudTank@reddit
W
FromTheThumb@reddit
Is helpful too.
Xzaphan@reddit
I do C-z all the time by mistake. It take me weeks to understand what it actually doing!
Mister_Magister@reddit (OP)
If you don't know yet, learn ctrl+d (it does same thing as exit)
kalam_burgud@reddit
Nice, now try typing: write and hit enter :-)
Mister_Magister@reddit (OP)
>write: you have write permission turned off
brother turned off my writing permissions
kalam_burgud@reddit
wall okidoki
midgaze@reddit
On systems without a bunch of crap from packages polluting /bin and /usr/bin (basically BSD) you can learn a lot from checking the contents of these directories. On (most?) linux distros there's too much noise in there for it to be of much use.
HighKing81@reddit
I had to check for active users so often that it was the first thing I did after logging in... automatically. 99% of the time I didn't even need it. It was something I did without thinking.
I quit my IT job two years ago. Still do it sometimes when I login to my homeserver that no one else uses haha
femuuuu@reddit
You're not the only one. That's how I found about it too lol
someweirdbanana@reddit
same lol
screwdriverfan@reddit
Well damn. That's a... w.
Picorims@reddit
So many easter eggs possible...
a : waves at you b : prints a bee f : prints the pay respect meme u : "me ?" y : prints the whole history of GNU/Linux z : faints putting the device to sleep (probably not a good idea...)
AkelGe-1970@reddit
z
is a utility you can install to do fuzzy cd. The real tool is calledzoxide
, there is alsozsh-z
for zsh usersvitimiti@reddit
None of those are standard, just like sl giving you a sarcastic error or forgetting your sudo password insulting you, they are extensions (if they exist at all)
ruby_R53@reddit
i wonder where those are from, 'cos i don't have them here on Gentoo
definitive_solutions@reddit
Manjaro zsh neither
Picorims@reddit
It's all made up, they do not exist.
ruby_R53@reddit
i guess it comes from the commenter's head then xd
Snoo_4704@reddit
But we can make them live with aliases 💯
ruby_R53@reddit
or scripts, rather, which still shouldn't be hard to make
East_Nefariousness75@reddit
Now that you know who is logged in, try out
$ wall
SmartCustard9944@reddit
W discovery
kompiler@reddit
I remember learning about this way back when first learnt how to finger users.
throwaway490215@reddit
Yesterday and some kid told you that's a 'w'?
firedocter@reddit
I like to think of it as who what where when (not in that order)
whosdr@reddit
Read the source to find out How!
Tempus_Nemini@reddit
it works!!! just wow ))
GirthyPigeon@reddit
It's a shortcut for
who.
Also, trycowsay
,oneko
,yes
andcmatrix
.cowsay
- Displays a cow speaking your message.oneko
- shows Neko on your command line.yes
- Automatically answers "yes" where the command requires you to type it in to agree.Source
Mister_Magister@reddit (OP)
why lie? no it is not?
```
\~/t/diff$ who
foidbgen seat0 2025-08-25 17:19 (:0)
foidbgen tty2 2025-08-25 17:19 (:0)
\~/t/diff$ w
02:53:25 up 7 days, 9:35, 1 user, load average: 3.85, 3.46, 2.99
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
foidbgen tty2 - 25Aug25 7days 4:49m 0.03s
```
gmes78@reddit
No need to be inflammatory.
GirthyPigeon@reddit
Shows the logged in user information on both, which is what I meant. The w command just shows more detail without parameters.
https://phoenixnap.com/kb/linux-who-command
Sorry-Climate-7982@reddit
Now type "who"
I00I-SqAR@reddit
Works on macOS too:
Mac:\~ lars$ w
1:38 up 12 days, 3:18, 3 users, load averages: 2,10 2,34 2,45
USER TTY FROM LOGIN@ IDLE WHAT
lars console - 20Aug25 12days -
lars s001 - 22Aug25 - w
lars s000 - 20Aug25 12days -bash
Mac:\~ lars$
krum@reddit
That command I think was even in original Xenix