performance improvement.
The sample mount point (/home) entry in /etc/fstab may look like:
$ cat /etc/fstab | grep home
/dev/sda2 /home ext3 defaults,noatime,nodiratime 0 0
Useful Tips for GNU/Linux Operating System
$ cat /etc/fstab | grep home
/dev/sda2 /home ext3 defaults,noatime,nodiratime 0 0
## (1) Windows XP in /dev/sda1
menuentry "Windows XP" {
set root=(hd0,1)
chainloader +1
}
# DEVICE NAME CONVERSIONS
#
# Linux Grub
# -------------------------
# /dev/fd0 (fd0)
# /dev/sda (hd0)
# /dev/sdb2 (hd1,2)
# /dev/sda3 (hd0,3)
#
$ du /path/to/dir | sort -nr
$ du --max-depth=2 /path/to/dir | sort -nr
## download latest pidgin from pidgin.im (at this time 2.6.3 is latest)
$ wget http://sourceforge.net/projects/pidgin/files/Pidgin/pidgin-2.6.3.tar.bz2
## extract files using tar
$ tar -zxvf pidgin-2.6.3.tar.bz2
$ cd pidgin-2.6.3
## Configure, Compile, and make
$ ./configure --disable-screensaver --disable-vv --disable-avahi --disable-tcl --disable-tk --prefix=/usr
$ make
$ sudo make install
$ ./find_files_between_times.pl /path/to/dir 5 2
#!/usr/bin/perl -w
#===============================================================================
#
# FILE: find_files_between_times.pl
#
# USAGE: ./find_files_between_times.pl <dir> <start_hour> <end_hour>
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Mitesh Singh Jat (mitesh), <mitesh[at]yahoo-inc[dot]com>
# COMPANY: Yahoo Inc, India
# VERSION: 1.0
# CREATED: 11/13/2009 10:00:02 PM IST
# REVISION: ---
#===============================================================================
use strict;
use warnings;
if (@ARGV != 3)
{
print STDERR "Usage: $0 <dir> <start_hour> <end_hour>\n";
exit(-1);
}
my $dir = $ARGV[0];
## Calculate current_hour - given_hour
#my $start_time = `/bin/date "+\%H"`;
my $start_time = $ARGV[1];
#chomp($start_time);
my $end_time = $ARGV[2];
$end_time = time - ($end_time * 60 * 60);
#$end_time = $start_time - $end_time;
#$start_time = $start_time - $ARGV[0];
if ($start_time > $end_time)
{
($start_time, $end_time) = ($end_time, $start_time);
}
my $cmd = "find $dir -ctime -$start_time";
print "Running $cmd\n";
my @files = `$cmd`;
foreach my $file (@files) # (`find $dir -ctime $start_time`)
{
chomp($file);
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($file);
if ($ctime > $end_time)
{
next;
}
print "$file\n";
}
exit(0);