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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ac Command Examples in Linux

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.

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. ltrace: command not found
  2. halt: command not found
  3. How to uninstall nodejs software package in Ubuntu
  4. qm snapshot Command Examples in Linux
  5. steghide Command Examples in Linux
  6. cradle elastic: Manage the Elasticsearch instances for a Cradle instance
  7. ldd Command Examples in Linux
  8. radeontop Command Examples in Linux
  9. CentOS / RHEL : How to remove unused Physical Volume(PV) from Volume Group (VG) in LVM
  10. CentOS / RHEL : How to make iptable rules persist across reboots

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright