Who can date, time and ip address, adding in .bashrc file

The diferent people login in my server and executed commands a lot, and I want undrestand, commadns is executed by what IP Address with Date and Time.
How can I Date, Time and IP Address adding to in .bashrc file ?

How can I do this?

I thank you in advance tips

You can overcome this issue by using the commands history and last

history displays the executed commands and last will displays the login’s along with ip address and time

First of all change the history format

#HISTTIMEFORMAT="%d/%m/%y %T "

now check the commands executed at particular time


for login details


and compare the outputs of both commands history and last

1 Like

Thank you Raghuu. I execute below command :
“#HISTTIMEFORMAT=”%d/%m/%y %T "

but then I run history command after that it dosn’t disply any ip address.

for example : this is history command :
2071 01/10/16 14:41:39 vim /etc/passwd 2072 01/10/16 14:41:44 vim /etc/shadow

I want to understand which ip address run which commands.

i have a problem. i have a user on my server “for example : Alex”. when Alex login to server, i diden’t understand which commands he execute on my server becuse Alex doesn’t home directory and bash_history file.

How can i give home directory to Alex user so that he would has a bash_history file?