• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Oracle Software Group Accounts OSDBA, OSOPER, Oracle Inventory group
  2. Permission Table for a File/Directory And File System Users Types
  3. ip Command Examples to Manage Networking in Linux
  4. CentOS / RHEL : How to prioritize the devices used for swap partition
  5. How to Stop Audit Log Entries Written to System Logs in CentOS/RHEL 6
  6. How to extract RAR files in CentOS/RHEL 7 and 8
  7. How to check failed or bad login attempts in Linux
  8. CentOS / RHEL : How to find if a network port is open or not?
  9. 11 Useful “ssh” and “scp” Commands in Linux
  10. How to Re-generate initramfs and vmlinuz for Rescue Kernel with Current Kernel in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary