{"id":3188,"date":"2022-12-20T16:43:45","date_gmt":"2022-12-20T19:43:45","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/lastlog-man8\/"},"modified":"2022-12-20T16:43:45","modified_gmt":"2022-12-20T19:43:45","slug":"lastlog-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/lastlog-man8\/","title":{"rendered":"LASTLOG (man8)"},"content":{"rendered":"<h1 align=\"center\">LASTLOG<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#NOTE\">NOTE<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#CAVEATS\">CAVEATS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">lastlog \u2212 reports the most recent login of all users or of a given user<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"26%\">\n<p style=\"margin-top: 1em\"><b>lastlog<\/b> [<i>options<\/i>]<\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>lastlog<\/b> formats and prints the contents of the last login log \/var\/log\/lastlog file. The <i>login\u2212name<\/i>, <i>port<\/i>, and <i>last login time<\/i> will be printed. The default (no flags) causes lastlog entries to be printed, sorted by their order in \/etc\/passwd.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The options which apply to the <b>lastlog<\/b> command are:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212b<\/b>, <b>\u2212\u2212before\u00a0<\/b><i>DAYS<\/i><\/p>\n<p style=\"margin-left:17%;\">Print only lastlog records older than <i>DAYS<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212C<\/b>, <b>\u2212\u2212clear<\/b><\/p>\n<p style=\"margin-left:17%;\">Clear lastlog record of a user. This option can be used only together with <b>\u2212u<\/b> (<b>\u2212\u2212user<\/b>)).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212h<\/b>, <b>\u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:17%;\">Display help message and exit.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212R<\/b>, <b>\u2212\u2212root\u00a0<\/b><i>CHROOT_DIR<\/i><\/p>\n<p style=\"margin-left:17%;\">Apply changes in the <i>CHROOT_DIR<\/i> directory and use the configuration files from the <i>CHROOT_DIR<\/i> directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212S<\/b>, <b>\u2212\u2212set<\/b><\/p>\n<p style=\"margin-left:17%;\">Set lastlog record of a user to the current time. This option can be used only together with <b>\u2212u<\/b> (<b>\u2212\u2212user<\/b>)).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212t<\/b>, <b>\u2212\u2212time\u00a0<\/b><i>DAYS<\/i><\/p>\n<p style=\"margin-left:17%;\">Print the lastlog records more recent than <i>DAYS<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212u<\/b>, <b>\u2212\u2212user\u00a0<\/b><i>LOGIN<\/i>|<i>RANGE<\/i><\/p>\n<p style=\"margin-left:17%;\">Print the lastlog record of the specified user(s).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The users can be specified by a login name, a numerical user ID, or a <i>RANGE<\/i> of users. This <i>RANGE<\/i> of users can be specified with a min and max values (<i>UID_MIN\u2212UID_MAX<\/i>), a max value (<i>\u2212UID_MAX<\/i>), or a min value (<i>UID_MIN\u2212<\/i>).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the user has never logged in the message <i>** Never logged in**<\/i> will be displayed instead of the port and time.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Only the entries for the current users of the system will be displayed. Other entries may exist for users that were deleted previously.<\/p>\n<h2>NOTE <a name=\"NOTE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The lastlog file is a database which contains info on the last login of each user. You should not rotate it. It is a sparse file, so its size on the disk is usually much smaller than the one shown by &#8220;<b>ls \u2212l<\/b>&#8221; (which can indicate a really big file if you have in passwd users with a high UID). You can display its real size with &#8220;<b>ls \u2212s<\/b>&#8220;.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">\/var\/log\/lastlog<\/p>\n<p style=\"margin-left:17%;\">Database times of previous user logins.<\/p>\n<h2>CAVEATS <a name=\"CAVEATS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Large gaps in UID numbers will cause the lastlog program to run longer with no output to the screen (i.e. if in lastlog database there is no entries for users with UID between 170 and 800 lastlog will appear to hang as it processes entries with UIDs 171\u2212799).<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  lastlog \u2212 reports the most recent login of all users or of a given user <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,330,4],"class_list":["post-3188","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-lastlog","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3188"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3188\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}