MacOS: What file does the command `last` get its information from?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Can't seem to find where this last command gets its information from. Does anyone know what file it uses (specifically for Unix macOS) ?




Tried cat /var/log/wtmp, cat /var/run/utmp, cat /var/log/lastlog but all I get is: cat: [...]: No such file or directory . Tried cat /var/log/system.log and sudo cat /var/audit but these aren't it either. Is it just me or ? Where is this file ?










share|improve this question























  • What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
    – Cupcake Protocol
    Sep 13 at 17:10











  • Doesn't say anything about what file it uses.
    – Lion
    Sep 13 at 17:12











  • dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
    – Wildcard
    Sep 13 at 18:16










  • I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
    – Christopher
    Sep 13 at 20:25














up vote
1
down vote

favorite












Can't seem to find where this last command gets its information from. Does anyone know what file it uses (specifically for Unix macOS) ?




Tried cat /var/log/wtmp, cat /var/run/utmp, cat /var/log/lastlog but all I get is: cat: [...]: No such file or directory . Tried cat /var/log/system.log and sudo cat /var/audit but these aren't it either. Is it just me or ? Where is this file ?










share|improve this question























  • What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
    – Cupcake Protocol
    Sep 13 at 17:10











  • Doesn't say anything about what file it uses.
    – Lion
    Sep 13 at 17:12











  • dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
    – Wildcard
    Sep 13 at 18:16










  • I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
    – Christopher
    Sep 13 at 20:25












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Can't seem to find where this last command gets its information from. Does anyone know what file it uses (specifically for Unix macOS) ?




Tried cat /var/log/wtmp, cat /var/run/utmp, cat /var/log/lastlog but all I get is: cat: [...]: No such file or directory . Tried cat /var/log/system.log and sudo cat /var/audit but these aren't it either. Is it just me or ? Where is this file ?










share|improve this question















Can't seem to find where this last command gets its information from. Does anyone know what file it uses (specifically for Unix macOS) ?




Tried cat /var/log/wtmp, cat /var/run/utmp, cat /var/log/lastlog but all I get is: cat: [...]: No such file or directory . Tried cat /var/log/system.log and sudo cat /var/audit but these aren't it either. Is it just me or ? Where is this file ?







files find osx macintosh last






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 25 at 11:43









Sparhawk

8,53863489




8,53863489










asked Sep 13 at 17:06









Lion

957




957











  • What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
    – Cupcake Protocol
    Sep 13 at 17:10











  • Doesn't say anything about what file it uses.
    – Lion
    Sep 13 at 17:12











  • dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
    – Wildcard
    Sep 13 at 18:16










  • I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
    – Christopher
    Sep 13 at 20:25
















  • What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
    – Cupcake Protocol
    Sep 13 at 17:10











  • Doesn't say anything about what file it uses.
    – Lion
    Sep 13 at 17:12











  • dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
    – Wildcard
    Sep 13 at 18:16










  • I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
    – Christopher
    Sep 13 at 20:25















What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
– Cupcake Protocol
Sep 13 at 17:10





What does man last say? On typical unix it is stored in /var/log/wtmp and on the FreeBSD I have handy it is /var/log/utx.log
– Cupcake Protocol
Sep 13 at 17:10













Doesn't say anything about what file it uses.
– Lion
Sep 13 at 17:12





Doesn't say anything about what file it uses.
– Lion
Sep 13 at 17:12













dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
– Wildcard
Sep 13 at 18:16




dtruss is Mac's strace equivalent; you should be able to use dtruss to find this information.
– Wildcard
Sep 13 at 18:16












I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
– Christopher
Sep 13 at 20:25




I think these are now stored in Apple SysLog (ASL) database files in /var/log/asl/*.
– Christopher
Sep 13 at 20:25










2 Answers
2






active

oldest

votes

















up vote
2
down vote













According to the manual (man last refers to man utmpx), /var/run/utmpx.






share|improve this answer




















  • man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
    – Lion
    Sep 13 at 17:49


















up vote
2
down vote













It used to be /var/log/wtmp before Mac OS 10.3, according to Apple header file commentary. That file no longer exists and is not used. The underlying C library functions for accessing the login database, upon which last is based, now talk to ASL.



Further reading



  • Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468846%2fmacos-what-file-does-the-command-last-get-its-information-from%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    According to the manual (man last refers to man utmpx), /var/run/utmpx.






    share|improve this answer




















    • man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
      – Lion
      Sep 13 at 17:49















    up vote
    2
    down vote













    According to the manual (man last refers to man utmpx), /var/run/utmpx.






    share|improve this answer




















    • man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
      – Lion
      Sep 13 at 17:49













    up vote
    2
    down vote










    up vote
    2
    down vote









    According to the manual (man last refers to man utmpx), /var/run/utmpx.






    share|improve this answer












    According to the manual (man last refers to man utmpx), /var/run/utmpx.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 13 at 17:13









    DopeGhoti

    41.3k55180




    41.3k55180











    • man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
      – Lion
      Sep 13 at 17:49

















    • man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
      – Lion
      Sep 13 at 17:49
















    man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
    – Lion
    Sep 13 at 17:49





    man utmpx only says this about the utmpx file. "Currently logged in users are tracked in /var/run/utmpx", whereas the last command displays the history of all login/outs since the file (that I'm looking for) was created. @DopeGhoti
    – Lion
    Sep 13 at 17:49













    up vote
    2
    down vote













    It used to be /var/log/wtmp before Mac OS 10.3, according to Apple header file commentary. That file no longer exists and is not used. The underlying C library functions for accessing the login database, upon which last is based, now talk to ASL.



    Further reading



    • Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.





    share|improve this answer
























      up vote
      2
      down vote













      It used to be /var/log/wtmp before Mac OS 10.3, according to Apple header file commentary. That file no longer exists and is not used. The underlying C library functions for accessing the login database, upon which last is based, now talk to ASL.



      Further reading



      • Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.





      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        It used to be /var/log/wtmp before Mac OS 10.3, according to Apple header file commentary. That file no longer exists and is not used. The underlying C library functions for accessing the login database, upon which last is based, now talk to ASL.



        Further reading



        • Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.





        share|improve this answer












        It used to be /var/log/wtmp before Mac OS 10.3, according to Apple header file commentary. That file no longer exists and is not used. The underlying C library functions for accessing the login database, upon which last is based, now talk to ASL.



        Further reading



        • Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 14 at 0:16









        JdeBP

        29.7k461136




        29.7k461136



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468846%2fmacos-what-file-does-the-command-last-get-its-information-from%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?