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
How to install kismet on MacBook, Mac OS X 10.5.6 Leopard How to installed and run kismet. cd /tmp svn co https://www.kismetwireless.net/code/svn/trunk kismet-devel cd kismet-devel ./configure sudo make install Edit kismet config file like: sudo vim /opt/local/etc/kismet.conf and change the following two lines: a.) suiduser=Your_Username_For_Mac b.) source=darwin,en1,airport_extreme Run kismet and enjoy! sudo kismet

What's the difference between 802.11a, 802.11b, and 802.11g?

What's the difference between 802.11a, 802.11b, and 802.11g? The first difference is that 802.11a uses the 5GHz radio frequency (RF) spectrum while 802.11g and 802.11b share the 2.4GHz spectrum. Therefore 802.11a will not interfere with 802.11g or 802.11b. Since 802.11a uses the 5GHz spectrum, it will have less distance capabilities due the physical nature of electromagnetic radiation. 802.11b and 802.11g use an RF spectrum that allows for 3 non-interfering channels (in North America). 802.11a uses a wider spectrum that allows for 12 non-interfering channels which will be 23 non-interfering channels with soon to be released standard. The idea of non-interfering (or non-overlapping) channels allows more wireless users to be concentrated in an area without having to share the transmission medium. 802.11b, while sharing the same 2.4GHz frequency spectrum as 802.11g, has lower transmission rates and different modulation techniques than 802.11g. For a discussion of transmission ra