This article covers all you need to know about the w command in Linux. In fact, The w command is a built-in tool that allows administrators to view information about users that are currently logged in. This includes their username, where they are logged in from, and what they are currently doing.
w Command in Linux Syntax
The Linux w command is a system utility that displays information about currently logged-in users. It uses the following syntax:
$ w [options] [username]
- [options]: Options that change the way the command behaves.
- [username]: Entering the name of a specific user only shows information about that particular user in the output.
The w command uses the following options:
- -h, --no-header Print output without the header.
- -u, --no-current Ignores username when calculating current process times and load.
- -s, --short Print output in the short format.
- -f, --from Toggle printing the FROM (remote hostname) field.
- --help Display help text.
- -i, --ip-addr Replace the hostname in the FROM field with the IP address.
- -V, --version Display current command version.
- -o, --old-style Print old-style output (blank space for idle times shorter than 1 minute).