Using a for loop in bash to read a file line by line can sometimes be very annoying, here’s a little trick to make it actually red it LINE BY LINE.
Tag: bash

Add date and time to bash history
The .bash_history file has no date or time information in it. Sometimes it would be very nice to know when some command got executed. What i did is add the following 2 lines in /etc/profile: HISTTIMEFORMAT=’%F %T ‘ export HISTTIMEFORMAT Now logout, and log back in. Execute a command and check ‘history’: mark@localhost:~$ history 1 […]