Here’s a quick way to reload your bachrc file without having to invoke a new shell.
[root@bambee]# source ~/.bashrc
or
[root@bambee]# . ~/.bashrc

Here’s a quick way to reload your bachrc file without having to invoke a new shell.
[root@bambee]# source ~/.bashrc
or
[root@bambee]# . ~/.bashrc
rpm -qa --last will return all installed rpm packages with their installed time. The last installed packages will be at the top of the list.
rpm -qa --last | less is will return all installed packages with their install date. Less allows you to scroll through the results.
rpm -qa --last | tail -n [lines] will return the last 5 packages. Replace [line] with any number you want, in my case 5 for file lines.
[root@bambee root]# rpm -qa –last | tail -n 5
termcap-11.0.1-17.1 Tue 09 May 2006 03:02:53 PM MYT
setup-2.5.27-1 Tue 09 May 2006 03:02:52 PM MYT
filesystem-2.2.1-3 Tue 09 May 2006 03:02:52 PM MYT
basesystem-8.0-2 Tue 09 May 2006 03:02:52 PM MYT
redhat-logos-1.1.14.3-1 Tue 09 May 2006 03:02:51 PM MYT
rpm -qa --last | grep [package name] will return the install date for a specific RPM package. In my case the apache web server [httpd]
[root@jumbo root]# rpm -qa –last | grep httpd
redhat-config-httpd-1.1.0-4.30.2 Sat 29 Mar 2008 09:03:40 PM MYT
httpd-2.0.46-70.ent Sat 29 Mar 2008 08:58:19 PM MYT
A friend needed help changing the system date on his Linux box today. This is usually a simple task for Linux users but newbies tend to get confused by the "date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]” line in the man page.
To simplify, this is how you do it.
Set the current date to April 7 2008 8:42:45pm.
The easy way,
#date -s "7 April 2008 20:42:45"
The harder way,
#date 040720422008.45
The break down: MM DD hh mm YYYY ss
MM = month = 04
DD = day = 07
hh = hour = 20
mm = minute = 42
YYYY = year = 2008
ss = second = 450
Not many people I know use the tee command but I find it quite useful. I tend to use it quite often in my scripts actually.
So what does it do?
The tee command has the ability to take the standard input and redirected it to multiple outputs. For example, the ls command would normally just return file names on your screen but what if you also need to keep a log of those file names in a text file.
Using the tee command you could simply write something like this “ls * | tee -a output.txt“. The command will return the file names on screen and also append them to the output.txt file. Screenshot below,
A lightly more complex use of the command. I have a file with duplicate entries. Combining the tee command with the uniq and sort commands I am able print the desired output on screen and also dump it into the file output_sorted.txt. Screenshot below,
There are way more usages for the tee command but for today I stuck to the basic. I’ll try to post more about it in the future.
