• 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. How to Re-Create the Yum Cache and/or Force a Fetch of the Package List of the Enabled Repositories
  2. kvm-img: command not found
  3. How to Configure rsyslog Server to Accept Logs via SSL/TLS
  4. “uname” Command Examples to Check UNIX/Linux Version
  5. cpio command – copies, lists & extracts files to and from archives
  6. How to Start, Stop and Restart Zimbra Service
  7. restorecon Command Examples in Linux
  8. more Command Examples in Linux
  9. chromium-browser: command not found
  10. CentOS / RHEL 7 : How to change the verbosity of debug logs during booting

You May Also Like

Primary Sidebar

Recent Posts

  • qemu-system-x86_64: command not found
  • timedatectl: command not found
  • mpirun.openmpi: command not found
  • startkde: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright