≡ Menu

w command

Linux: Log Everyone Out Of The System

I can login as root user on Debian or Ubuntu/RHEL/CentOS Linux based system. I need to log everyone off (all ssh users) to install new kernel and/or hardware. How do I do this on Linux? What is the best way to logout ALL USERS remotely over the ssh based session in Linux like operating systems?
[click to continue…]

Linux / Unix: w Command Examples

w command

I am a new Linux and Unix system user. How do I list current users and find out what they're doing on Linux or Unix-like operating system using shell prompt?
[click to continue…]

Linux / Unix: Find Out What tty I’m Using

What is a tty under Linux / UNIX? How do I find out what tty I'm on?
[click to continue…]

Linux / UNIX: See If Particular Users Are Logged Into Server

How do I see if my friends or coworkers are logged into the same Linux or BSD or UNIX (AIX, HP-UX, Apple OS X) server / workstation as I am from a command line?
[click to continue…]

UNIX / Linux List Current Logged In Users

How do I print the user names of users currently logged in to the current UNIX / Linux host / server from a command prompt?
[click to continue…]

Linux Logout user / Logoff User Commands

I am a new Linux sysadmin. I am using Linux on HP server. How do I logout users from my systems? How can I forcefully logoff any user using bash shell on Linux?
[click to continue…]

Linux / UNIX find out what other users are doing?

Q. Can you explain the command to find what users are doing on my UNIX / Linux system?

A. Both Linux and UNIX (FreeBSD/Solaris) has w command to show who is logged on and what they are doing.

The w command prints a summary of the current activity on the system, including what each user is doing.

=> The first line displays the current time of day

=> How long the system has been running

=> The number of users logged into the system

=> The load averages. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.

You can also use ps command which shows you process that are running on the system.

Type w command displays information about the users currently on the machine, and their processes.

Show who is logged on and what they are doing with w command

The fields output are the user's login name, the name of the terminal the user is on, the host from which the user is logged in, the time the user logged on, the time since the user last typed anything, and the name and arguments of the current process.
$ w

radm    pS     Sun01PM  1day -bash
raj     pW  7:42AM     5 ssh root@
miku    pX a80-186-82-84.el  7:28AM    10 screen irssi
vivek   pY    4:11AM     0 nano -w hireme
rani    q0 dslbr0.bsnl.in    7:32AM    12 lynx http://slashdot.org/
jadmin  q2 dslbr5.bsnl.in    7:33AM     0 ssh jadmin@host.cyberciti.info
gad     q3 dslbr76.bsnl.in   7:40AM     0 -ksh
bencs   q5 dslbr22.bsnl.in   7:44AM     5 -zsh
vivek   q6 gw11-vsnl.in      7:47AM    11 -bash

You can use the ps command shows you processes that are running on the system:

$ ps -au | more
$ ps -au | less

So you can use both w and ps commands to find out who's doing what.

Server Uptime Command To Find Out How Long The System Has Been Running

I'd like to find out how long the system has been running under UNIX or Linux operating system. How do I find out system uptime?
[click to continue…]