User:RytoEX/Notes

Just some notes for me. Might use them later.

=Unix commands= UNIX commands is protected, but its redirect page http://wiki.dreamhost.com/index.php?title=Unix_commands&redirect=no is not.

The last section, Users, mentions the following: To get login details: last

It may be useful to add the following.

To get login details for the current month: last -i

To get login details for the previous month last -if /var/log/wtmp.1

For some reason, here are some alternates that showed up elsewhere on the wiki which pipe "last" into "grep", but they fail if the username is longer than 8 characters because the output of "last" will cut off the username after the 8th character. last | grep last -i | grep last -if /var/log/wtmp.1 | grep

A DreamHost forum thread suggests the following instead: /usr/bin/last -i | /bin/grep $(/bin/echo $USER | /usr/bin/cut -c -8) /usr/bin/last -if /var/log/wtmp.1 | /bin/grep $(/bin/echo $USER | /usr/bin/cut -c -8)