Open In App
Related Articles

w command in Linux with Examples

Improve Article
Save Article
Like Article

The ‘w’ command in Linux gives us important information about who is currently using the computer, how much the computer is being used, and what programs are running. It’s a handy tool for people who take care of computer systems, as it helps them keep an eye on what users are doing, how much of the computer’s power is being used, and how to make everything run smoothly.

Syntax of `w` command in Linux

w [options] user [...]

The output includes the following columns:




Displays the username of the logged-in user.


Shows the terminal device associated with the user session.


Indicates the remote host or IP address the user is connected to


Displays the time at which the user logged in.


Shows the duration of inactivity since the user’s last interaction.


Represents the CPU time used by all processes attached to the user’s session.


Displays the percentage of CPU time used by the user’s current process.


WHAT: Provides information about the command or process running in the user’s session.

Options Available in `w` command in Linux




Suppresses the header row from being displayed in the output.


Ignores the username when calculating the current process and CPU times.


Uses the short format, omitting the login time, JCPU (total CPU time used by all processes), and PCPU (CPU time used by the current process) times.


Toggles the printing of the ‘from’ field (remote hostname). By default, it is not printed, but this option can change that.


Displays a help message that provides information about the usage and options of the ‘w’ command.


Displays the IP address instead of the hostname in the ‘from’ field.


Displays version information about the ‘w’ command.


Prints a blank space for idle times that are less than one minute.


Shows information about the specified user only.


w -h: This option doesn’t print the header.

w -h

w -u: This option will ignore the username while figuring out the current process and cpu times.

w -u

w -s : This option uses the short format. It will not print the login time, JCPU or PCPU times.

w -s

w -f : This option will toggle printing the from (remote hostname) field. The default as released is from field which not be printed. Although your system administrator or your distribution maintainer may have compiled a version in which the from field is shown by default.

w -f

w –help: This option will display help message and exit.

w --help

w -i : This option will display IP address instead of hostname for from field.

w -i

w -V : This option will display version information.

w -V

w -o : This option will print blank space for idle times less than one minute.

w -o

w user : This option will show information about the specified user only.

w user


In this we discussed about `w` command in Linux w is used for administrators to monitor user activity, manage system resources and optimize performance. It also provides valuable information about logged-in users, system load, and active processes. Overall, we can say that it is an essential utility for efficient system administration in Linux.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 31 Jul, 2023
Like Article
Save Article
Similar Reads