• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

w Command Examples in Linux

by admin

The w command shows who is logged on and what they are doing. 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.

Syntax:

# w [options]

Example:

 w
20:13  up 10 days,  3:25, 2 users, load averages: 2.33 2.04 3.44
USER     TTY      FROM              LOGIN@  IDLE WHAT
geek    console  -                25Mar22 10days -
geek    s000     -                Sun12       - w

w Command Examples

1. To see whos logged in:

# w 

2. Do not print header in the output:

# w -h

3. To ignore the username:

# w -u 

4. To toggle the “from” field:

# w -f 

5. Use the short format. Don’t print the login time, JCPU or PCPU times.

# w -s

6. Display IP address instead of hostname for from field.

# w -i

7. Show information about the specified user only.

# w [user]

8. To get the version information:

# w -V 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to shrink root filesystem on CentOS / RHEL 6
  2. CentOS / RHEL 7 : Understanding Kexec and Kdump
  3. 10 Sed (Stream Editor) Command Examples
  4. chpasswd : command not found
  5. Passwordless SSH not working for local users on LDAP servers – CentOS/RHEL 7
  6. datamash Command Examples in Linux
  7. wifi-menu Command Examples in Linux
  8. snap: command not found
  9. isoinfo Command Examples in Linux
  10. light: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright