• 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 not found

by admin

The w command is primarily used to display the details of users who are currently logged in to a system and their transactions. The first line of the output displays the status of the system. The second line of the output displays a table with the first column listing the users logged in to the system and the last column indicating the current activities of the users. The remaining columns of the table show different attributes associated with the users.

Syntax

The syntax of the w command is:

$ w [options] [user name]

An example of the w command is shown in the following example:

# w
 16:48:16 up 348 days,  8:06,  1 user,  load average: 2.90, 3.53, 3.51
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
geek pts/77   xx.xx.xx.xx          11:11    0.00s  0.31s  0.09s sshd: geek[priv]

The output shows rows of data with the following columns:

Field Description
USER User login name
TTY The controlling Terminal type, listed as pts/N (pseudo-terminal) in GUI, or ttyN on the system console or other directly connected device
FROM Remote hostname from which the user has logged in
LOGIN@ Login time of the user
IDLE How long it has been since the user typed any input on that Terminal
JCPU CPU time consumption of all the processes attached to tty, including jobs currently running in the background
PCPU CPU time consumption of the current processes named in the WHAT field
WHAT The command line of the process currently executing

If you encounter below error while running the w command:

w: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Arch Linux pacman -S procps-ng
CentOS yum install procps-ng
Fedora dnf install procps-ng

w Command Examples

1. Show logged-in users info:

$ w

2. Show logged-in users info without a header:

$ w -h

Filed Under: Linux

Some more articles you might also be interested in …

  1. mpstat Command Examples in Linux
  2. How to install CentOS / RHEL 7 on RAID Partition
  3. expect: command not found
  4. netcat Command Examples in Linux
  5. CentOS / RHEL 7 : How to configure kdump
  6. Linux OS Service ‘hplip’
  7. mocp: command not found
  8. certbot Command Examples in Linux
  9. Linux “shutdown”, “poweroff”, “halt”, “reboot” Commands
  10. bastet: Clone of the game Tetris in the terminal

You May Also Like

Primary Sidebar

Recent Posts

  • dig: DNS lookup utility
  • diffstat: Create a histogram from the output of the diff command
  • diffoscope: Compare files, archives, and directories
  • diff-pdf: Tool for comparing two PDFs

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright