-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Feb 27, 2016 at 12:30:20PM +0500, Muhammad Yousuf Khan wrote: > I have been trying one user to monitor his history. however every time i > "cat /home/username/.bash_history" i see always the same history as old one. > I want to monitor his history. no matter how many sessions but every > command should go to same history file. > > Any advice or guidance will be highly appreciated.
I don't know exactly what your problem is, but take into account that bash only appends its (in-memory) history to .bash_history at exit (so while the shell is active you won't see any changes). You can force a premature appending of the history to the history file with "history -a". See the section "HISTORY" in the bash manual and/or enter "help history" into any friendly bash in your neighbourhood :-) - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlbRYeMACgkQBcgs9XrR2kafiACfZ7dVu7xnzruBg3aQUeHuQlxp mAEAnic7ZThgwhGTi5UY/Y1yVKIWz4Yf =209w -----END PGP SIGNATURE-----