accton command in Linux with Examples

accton is one of important Linux/Unix command which is used by the administrator to monitor user activities. It is used to turn on or turn off the process for accounting or change info process accounting file. When the command is run in the terminal without any argument, it stops the process accounting.

Syntax:

accton [OPTION] on|off| file_name

Here, file_name is the name of the file where process accounting information is to save.

The system’s default process accounting file is saved in ‘/var/log/account/pacct‘. The default path of the file might change with different Linux platform i.e. it might be different for Red Hat or other Linux based platform. Usually, the process accounting is enabled automatically at boot time by the system itself.

Example 1: To turn on the process for accounting.

Input:

Output:

Example 2: To turn off the process for accounting.

Input:

Output:

Example 3: To save process accounting in a particular file let’s say the file name is geeksforgeeks.txt we can use the following command.

accton geeksforgeeks.txt

Input:

Output:

Options:

  • -h, –help: Shows help and exit.

  • -V, –version: Show version and exit.



My Personal Notes arrow_drop_up

Blogger, Linux lover, Tech enthusiast, Engineer

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.