• 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

CentOS / RHEL : How to find which user run a specific command?

by admin

Question: How can I tell which user ran a specific command ? or If the user clears their .bash_history can I still tell who ran a command?

Answer:

Using the process accounting tools, you can get basic information about who ran a specific command. Below are the steps to find out who run the command.

1. The service must be running before the accounting will take place, this is achieved with the command:

# /etc/init.d/psacct start

2. This can be enabled to run at every boot with the command

# chkconfig psacct on

3. To find out who run a specific command, provide the command name as a parameter to the lastcomm command.

# lastcomm rm

And it should show you who run the command.

Filed Under: Linux

Some more articles you might also be interested in …

  1. make: command not found
  2. Install AzCopy on Linux – Fastest way to copy in Azure
  3. sm: command not found
  4. Using vmstat to troubleshoot performance issues in Linux
  5. timeshift Command Examples in Linux
  6. Configuring sudo to Enable Commands for Non-Root Users in Linux
  7. How to add header and trailer line to a file in Linux
  8. md5sum Command Examples in Linux
  9. How to Setup SSH keys for “passwordless” ssh login in Linux
  10. deluser: 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