Requirement’s
How to install and use Whoisusing tool
Step 1: clone the package
git clone https://github.com/ronrihoo/whoisusing.git
Step 2: change the directory
cd whoisusing
Step 3: Change the permission
The output is the name of the user.
Options:
-a : Return the actual filename associated with found processes$ whoisusing cups -a root cupsd cups-browsed lp dbus
The actual filenames retrieved for each user are separated from each other by a space.
-s : Returns only the results that have matching filenames
Notice the actual name above for user lp is too different from the searched name cups. In order to prevent this, the strict option flag, -s, will ensure that the associated filenames are a close match to the searched name.whoisusing cups -s root
Additionally, one may combine options for more detailed results, like so:
Similar to ps aux | grep mysql | awk ‘{ print $1, $2 }’ with the difference being that all of the associated PIDs of each unique user are listed on the same line, like so:
-d : Return the directories associated with the user who’s using the specified process
This can be combined with other options.
-l : Return the lines that were used to determine who the users are
The line returned is exactly similar to the output of ps aux | grep mysql. In case of multiple results, first all of the lines will be printed in the same respective order as the user names which follow.
Post a Comment