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?
HISTTIMEFORMAT modification. In /etc/bash.rc or /etc/profile?
centos;command history;bashrc;profile
I'd create a file with that string in it and add it to this directory, /etc/profiled.d. Call the file custom_histformat.sh, or something similar.Generally you don't want to add customizations to either of those 2 files (/etc/profile or /etc/bashrc), since they're owned by the system. Customizations can go into the /etc/profile.d directory.UPDATE #1At the risk of beating a dead horse I thought it important to highlight why one would use /etc/profile.d over the directories that were mentioned in the question or in @Gilles answer.If you look through any of the testing around RHCE they'll specify that /etc/profile.d is an appropriate place to make this type of change. So if you're taking the test and answer anything other than this, or /etc/bashrc or /etc/profile, you'd be wrong. Call it a RH-ism but this is just how it's done on distros based on Red Hat.. Other distros have other approaches.http://www.redhat.com/training/courses/ex300/