Skip to main content

How to Add Date And Time To Your Bash History on SuSE Linux

The Linux which came together with bash-3.x RPM and HISTORYcommand show insufficient information(at least for me) as example below:

1 vi /etc/hosts
2 rpm -qa|grep bash
3 cat /etc/SuSE-release
4 history

For any SuSE Linux Enterprise server 10 that managed by more than one people, I would suggest you should make history command more user friendly and more information for auditing purposes.

Edit /etc/bash.bashrc and append to the bottom:

export HISTTIMEFORMAT="%h/%d - %H:%M:%S "

save it.

Open a new SSH session and login as usual, try typing few command and exit. Login again and type history and you should be able to see more useful information which included date and time:

1 Jun/07 - 13:23:40 sudo tail -f /var/log/messages
2 Jun/07 - 13:23:40 cat /etc/hosts
3 Jun/07 - 13:23:40 env |grep DISPLAY
4 Jun/07 - 13:23:40 ps -ef|grep startx
5 Jun/07 - 13:23:40 env
6 Jun/07 - 13:23:40 date
7 Jun/07 - 13:23:40 ps -ef|grep abc
8 Jun/07 - 13:23:40 touch abc
9 Jun/07 - 13:23:40 /sbin/ifconfig
10 Jun/07 - 13:23:40 ping planetmy.com
11 Jun/07 - 13:23:40 cat abc
12 Jun/07 - 13:23:40 date

Source : http://www.planetmy.com/blog/how-to-add-date-and-time-to-your-bash-history-on-suse-linux/


Comments

Popular posts from this blog

Cisco Command "Auto secure"

Cisco Command "Auto secure" In today's article, I'm going to quickly inform you about the Privileged EXEC command named "auto secure". Network administrators (like you) use the "auto secure" command to secure the management and forwarding planes of a router. Another way of saying it is, CCNAs use this command to secure a router by disabling common IP services which can be exploited by attackers to initiate network attacks. When the command is typed on a router, it takes the user (ccna) through a command line-interface (CLI) semi-interactive session (which is also known as the AutoSecure dialogue). Below is the command's syntax: auto secure [management | forwarding] [no-interact | full] [ntp | login | ssh | firewall | tcp-intercept] As you can see, the command can use several "optional" keywords: management - This (optional) keyword is used to only secure the management plane of a router. forwarding - This (optional) keyword is used to...

NetSurveyor :: 802.11 (WiFi) Network Discovery / Scanner Tool

NetSurveyor :: 802.11 (WiFi) Network Discovery / Scanner Tool http://www.performancewifi.net/performance-wifi/main/NetSurveyor.htm NetSurveyor is an 802.11 (WiFi) network discovery tool and, as such, its goal in life is to gather information about nearby wireless access points in real time and display it in a useful way. Similar in purpose to NetStumbler , it includes many more features. The data is displayed using a variety of different diagnostic views and charts. Data can be recorded for extended periods and played-back at a later date/time. Also, reports can be generated in Adobe PDF format. Applications for NetSurveyor include the following: During the installation of a wireless network, as an aid in verifying the network is properly configured and antennas are positioned at locations to achieve efficient transmission / reception -- that is, for use in verifying WiFi coverage and maximizing beacon signal strength Trouble-shooting an existing network or wireless environm...

The Seven Habits

The Seven Habits Habit 1: Be Proactive - Changes starts form within; highly effective people make the decisions to improve their lives through the things that they can influence rather than simply reacting to external forces. Habit 2: Begin with the end with mind. - Develop a principle– centered personal mission statement into long- term goals based on personal principle. Habit 3: Put first thing first. - Spend time doing what fits into your personal mission, observing the proper balance between production and building production capacity. Identify the key roles that you take on in life, and make time for each other. Habit 4: Think win / win - Seek agreements and relationships that are mutually beneficial. In cases where a win / win deal cannot be achieved, accept the fact that agreeing to make “no deal”, may be the best alternative. In developing the organizational culture, be sure to reward win / win behavior among employees and avoid inadvertently rewarding win / lose behavior. Habi...