I'd like to add the date/time to the output of the history
command in CentOS/RHEL 6. I would like this to apply to all users on the machine by default. This itself is easy. It seems to just be a case of adding:
export HISTTIMEFORMAT="%Y%m%d %T "
Where should that be added? I've seen some conflicting info on whether to add this to /etc/profile
or /etc/bashrc
. I believe both would work equally well.
Does anyone have any advice as to which file I should use for this specific modification?
profile.d
and what you say makes perfect sense. I also was not sure as to whether this would be something specific to bash that would be best placed in a bash-specific file or something that can apply to all shells. Thanks! – batfastad Nov 06 '13 at 16:52debian
, too. (/etc/profile.d/ works out of the box.) – VasyaNovikov Aug 28 '15 at 12:41