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.
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.
Example 2: To turn off the process for accounting.
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.
- -h, –help: Shows help and exit.
- -V, –version: Show version and exit.