"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">     <html
xmlns="http://www.w3.org/1999/xhtml"> <head>
    <link            rel="stylesheet"             type="text/css"
href="../../../style.css" title="style" />
    <link  rel="stylesheet"  type="text/css"  href="../style.css"
title="style" />
    <meta             http‐equiv="content‐type"              con‐
tent="text/html;charset=utf‐8" />

    <title>ac(1) ‐ Linux manual page</title> </head>


<div        class="page‐top"><a       id="top_of_page"></a></div>
<!‐‐%%%TOP_BAR%%%‐‐> <!‐‐%%%PAGE_START%%%‐‐>

<table class="sec‐table"> <tr>
        <p class="section‐dir">  <a  href="#NAME">NAME</a>  |  <a
TION</a>    |     <a     href="#OPTIONS">OPTIONS</a>     |     <a
href="#FILES">FILES</a>   |  <a  href="#AUTHOR">AUTHOR</a>  |  <a
href="#SEE_ALSO">SEE&nbsp;ALSO</a>              |              <a
    <td class="search‐box">
        <div class="man‐search‐box">

            <form                 method="get"                ac‐
                <fieldset class="man‐search">
                    <input   type="text"    name="q"    size="10"
maxlength="255" value="" />
                    <input  type="hidden"  name="sitesearch" val‐
ue="man7.org/linux/man‐pages" />
                    <input type="submit" name="sa"  value="Search
online pages" />

    <td> </td> </tr> </table>

<pre>  <span  class="headline">AC(1)                      General
Commands Manual                      AC(1)</span>  </pre>  <h2><a
id="NAME"  href="#NAME"></a>NAME   &nbsp; &nbsp; &nbsp; &nbsp; <a
href="#top_of_page"><span                             class="top‐
       ac  ‐   print  statistics about users’ connect time </pre>
<h2><a id="SYNOPSIS" href="#SYNOPSIS"></a>SYNOPSIS  &nbsp; &nbsp;
&nbsp;    &nbsp;    <a    href="#top_of_page"><span   class="top‐
       <b>ac     </b>[  <b>‐d  </b>|  <b>‐‐daily‐totals  </b>]  [
<b>‐y </b>| <b>‐‐print‐year </b>]
              [   <b>‐p   </b>|  <b>‐‐individual‐totals  </b>]  [
<i>people</i> ]
              [ <b>‐f </b>|  <b>‐‐file  </b><i>filename</i>  ]  [
<b>‐a </b>| <b>‐‐all‐days </b>]
              [   <b>‐‐complain  </b>]  [  <b>‐‐reboots  </b>]  [
<b>‐‐supplants </b>]
              [ <b>‐‐timewarps </b>] [ <b>‐‐compatibility </b>]
              [ <b>‐‐tw‐leniency </b><i>num</i> ] [  <b>‐‐tw‐sus‐
picious </b><i>num</i> ]
              [  <b>‐z  </b>| <b>‐‐print‐zeros </b>] [ <b>‐‐debug
              [ <b>‐V </b>|  <b>‐‐version  </b>]  [  <b>‐h  </b>|
<b>‐‐help  </b>]  </pre>  <h2><a id="DESCRIPTION" href="#DESCRIP‐
TION"></a>DESCRIPTION    &nbsp;   &nbsp;   &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
       <b>ac </b>prints out a report of connect time  (in  hours)
based on the
       logins/logouts  in  the current <i>wtmp</i> file.  A total
is also printed

       The  accounting  file   <i>wtmp</i>   is   maintained   by
<b>init</b>(8) and <a href="../man1/login.1.html">login(1)</a>.
       Neither <b>ac </b>nor <b>login </b>creates the <i>wtmp</i>
if it doesn’t exist, no
       accounting is done.  To begin accounting, create the  file
with a
       length of zero.

       NOTE:   The  <i>wtmp</i>  file  can get really big, really
fast.  You might want
       to trim it every once and a while.

       GNU <b>ac </b>works nearly the same UNIX <b>ac</b>, though
it’s a little smarter in
       several  ways.  You should therefore expect differences in
the output
       of GNU <b>ac </b>and the output of  <b>ac</b>’s  on  other
systems.  Use the command
       <b>info  </b><i>accounting</i>  to get additional informa‐
tion.   </pre>  <h2><a  id="OPTIONS"  href="#OPTIONS"></a>OPTIONS
&nbsp;   &nbsp;   &nbsp;   &nbsp;   <a  href="#top_of_page"><span
       <b>‐d, ‐‐daily‐totals</b>
              Print totals for each day rather than just one  big
total at
              the end.  The output looks like this:
                      Jul  3  total     1.17
                      Jul  4  total     2.10
                      Jul  5  total     8.23
                      Jul  6  total     2.10
                      Jul  7  total     0.30
       <b>‐p, ‐‐individual‐totals</b>
              Print  time totals for each user in addition to the
              everything‐lumped‐into‐one value.  It looks like:
                      bob       8.06
                      goff      0.60
                      maley     7.37
                      root      0.12
                      total    16.15
       <i>people</i> Print out the sum total of the connect  time
used by all of the
              users included in <i>people.</i>  Note that <i>peo‐
ple</i> is a space
              separated list of valid user names;  wildcards  are
not allowed.
       <b>‐f, ‐‐file </b><i>filename</i>
              Read  from  the file <i>filename</i> instead of the
system’s <i>wtmp</i> file.
              When the <i>wtmp</i> file has a  problem  (a  time‐
warp, missing record,
              or whatever), print out an appropriate error.
              Reboot records are NOT written at the time of a re‐
boot, but
              when the system restarts; therefore, it is impossi‐
ble to know
              exactly  when  the reboot occurred.  Users may have
been logged
              into the system at the time of the reboot, and many
              automatically  count the time between the login and
the reboot
              record against the user (even though  all  of  that
              shouldn’t  be, perhaps, if the system is down for a
long time,
              for instance).  If you want to count this time, in‐
clude the
              flag.   *For  vanilla  <b>ac </b>compatibility, in‐
clude this flag.*
              Sometimes, a logout record is  not  written  for  a
              terminal,  so  the  time that the last user accrued
cannot be
              calculated.  If you want to include the  time  from
the user’s
              login  to  the  next  login on the terminal (though
              incorrect), include this you want  to  include  the
time from the
              user’s  login  to  the  next  login on the terminal
              probably  incorrect),  include  this  flag.    *For
vanilla <b>ac</b>
              compatibility, include this flag.*
              Sometimes,  entries in a <i>wtmp</i> file will sud‐
denly jump back into
              the past without a clock change  record  occurring.
It is
              impossible  to  know  how long a user was logged in
when this
              occurs.  If you want to count the time between  the
login and
              the  time warp against the user, include this flag.
              vanilla  <b>ac  </b>compatibility,   include   this
              This  is  shorthand  for typing out the three above
       <b>‐a, ‐‐all‐days</b>
              If we’re printing daily totals, print a record  for
every day
              instead of skipping intervening days where there is
no login
              activity.  Without this flag, time  accrued  during
              intervening  days  gets  listed  under the next day
where there is
              login activity.
       <b>‐‐tw‐leniency </b><i>num</i>
              Set the time warp leniency to  <i>num</i>  seconds.
Records in <i>wtmp</i>
              files  might be slightly out of order (most notably
when two
              logins occur within a one‐second period ‐ the  sec‐
ond one gets
              written  first).   By default, this value is set to
60.  If the
              program notices this problem, time is not  assigned
to users
              unless the <b>‐‐timewarps </b>flag is used.
       <b>‐‐tw‐suspicious </b><i>num</i>
              Set  the  time  warp suspicious value to <i>num</i>
seconds.  If two
              records in the <i>wtmp</i> file  are  farther  than
this number of
              seconds   apart,   there  is  a  problem  with  the
<i>wtmp</i> file (or your
              machine hasn’t been used in a year).  If  the  pro‐
gram notices
              this  problem, time is not assigned to users unless
              <b>‐‐timewarps </b>flag is used.
       <b>‐y, ‐‐print‐year</b>
              Print year when displaying dates.
       <b>‐z, ‐‐print‐zeros</b>
              If a total for any category (save the grand  total)
is zero,
              print it.  The default is to suppress printing.
              Print verbose internal information.
       <b>‐V, ‐‐version</b>
              Print  the  version number of <b>ac </b>to standard
output and quit.
       <b>‐h, ‐‐help</b>
              Prints the usage string and  default  locations  of
system files
              to   standard  output  and  exits.   </pre>  <h2><a
id="FILES" href="#FILES"></a>FILES  &nbsp; &nbsp;  &nbsp;  &nbsp;
<a              href="#top_of_page"><span             class="top‐
              The  system  wide  login  record   file.   See   <a
href="../man5/wtmp.5.html">wtmp(5)</a> for further
              details.    </pre>  <h2><a  id="AUTHOR"  href="#AU‐
THOR"></a>AUTHOR     &nbsp;    &nbsp;    &nbsp;     &nbsp;     <a
href="#top_of_page"><span                             class="top‐
       The GNU accounting utilities were written by Noel Cragg
       &lt;noel@gnu.ai.mit.edu&gt;. The man page was adapted from
the accounting
       texinfo  page by Susan Kleinmann &lt;sgk@sgk.tiac.net&gt;.
</pre> <h2><a id="SEE_ALSO" href="#SEE_ALSO"></a>SEE ALSO  &nbsp;
&nbsp;  &nbsp;  &nbsp;  <a  href="#top_of_page"><span class="top‐
       <a      href="../man1/login.1.html">login(1)</a>,       <a
href="../man5/wtmp.5.html">wtmp(5)</a>,     <b>init</b>(8),    <a
href="../man8/sa.8.html">sa(8)</a>  </pre>  <h2><a  id="COLOPHON"
href="#COLOPHON"></a>COLOPHON   &nbsp;  &nbsp;  &nbsp;  &nbsp; <a
href="#top_of_page"><span                             class="top‐
       This page is part of the <i>psacct</i> (process accounting
       project.  Information about the project can be found at
       ⟨<a                  href="http://www.gnu.org/software/ac‐
ct/">http://www.gnu.org/software/acct/</a>⟩.   If  you have a bug
report for
       this manual page, see  ⟨<a  href="http://www.gnu.org/soft‐
ware/acct/">http://www.gnu.org/software/acct/</a>⟩.  This page
       was  obtained  from  the tarball acct‐6.6.4.tar.gz fetched
       ⟨<a                       href="http://ftp.gnu.org/gnu/ac‐
ct/">http://ftp.gnu.org/gnu/acct/</a>⟩  on  2019‐07‐28.   If  you
discover any
       rendering problems in this HTML version of  the  page,  or
you believe
       there  is a better or more up‐to‐date source for the page,
or you have
       corrections or improvements to  the  information  in  this
       (which  is  <i>not</i>  part of the original manual page),
send a mail to

<span class="footline">                               2010 August
16                          AC(1)</span> </pre>

<hr class="end‐man‐text" />

<hr class="start‐footer" />

<div class="footer">

<table class="colophon‐table">
    <td class="pub‐info">
            HTML rendering created 2019‐08‐02
            by  <a  href="http://man7.org/mtk/index.html">Michael
            author of
            <a  href="http://man7.org/tlpi/"><em>The  Linux  Pro‐
gramming Interface</em></a>,
            maintainer of the
            <a href="https://www.kernel.org/doc/man‐pages/">Linux
<em>man‐pages</em> project</a>.
            For details of in‐depth
            <strong>Linux/UNIX system programming training  cour‐
            that  I  teach,  look <a href="http://man7.org/train‐
            Hosting   by    <a    href="http://www.jambit.com/in‐
dex_en.html">jambit GmbH</a>.
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid‐xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
    <td class="colophon‐divider">
    <td class="tlpi‐cover">
        <a                      href="http://man7.org/tlpi/"><img
alt="Cover of TLPI" /></a>
    </tr> </table>


<hr class="end‐footer" />

</body> </html>