I'd like to know how to set in .bashrc
file to print the last login time of users when logging into another user in terminal. I do know that with who
or last
, but I'd like something a little more customizable that can be formatted and only runs once per login, preferably to show in a format like so;
last login time [ 2015-02-13 @ 3:50:00 AM ]
user@host /path/dir/here $
that gets printed to the terminal screen before the bash prompt, and if possible to set and format color on the time and date stamp. How can I achieve this to customizing the bash prompt output?