• 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

ac: command not found

by admin

The ac command is a utility for displaying statistics about user activity on a Linux system. It reads data from the system’s accounting files and displays a summary of information about users’ login and logout times, the amount of time they spent logged in, and the number of processes they ran.

You can also use the -f option to specify the name of the accounting file to read data from. By default, ac reads data from the system’s default accounting file, which is usually located at /var/account/pacct.

For more information about the ac command and a complete list of options, you can refer to the man page by typing “man ac” at the command prompt.

If you encounter the below error while running the ac command:

ac: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install acct
Ubuntu apt-get install acct
Alpine apk add acct
Kali Linux apt-get install acct
CentOS yum install acct
Fedora dnf install acct
Raspbian apt-get install acct

ac Command Examples

1. Print how long the current user has been connected in hours:

# ac

2. Print how long users have been connected in hours:

# ac --individual-totals

3. Print how long a particular user has been connected in hours:

# ac --individual-totals {{username}}

4. Print how long a particular user has been connected in hours per day (with total):

# ac --daily-totals --individual-totals {{username}}

5. Also display additional details:

# ac --compatibility

Filed Under: Linux

Some more articles you might also be interested in …

  1. dir Command Examples in Linux
  2. How to change the Default Log Directory(/var/log) in Rsyslog for CentOS/RHEL 6,7
  3. How to Change runlevels/targets using systemd in Ubuntu
  4. mt Command Examples in Linux
  5. chrt Command Examples in Linux
  6. Image optimization with webp
  7. How to edit Virtual Machine Hardware in RedHat Virtualization
  8. lnav: command not found
  9. “-bash: route: command not found” on CentOS/RHEL 7
  10. How to Configure Network Interface Teaming in CentOS/RHEL 7 and 8

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright