Wednesday, September 24, 2008

Jiffy, Jiffies & HZ

Jiffies : The jiffies variable holds the number of times the system timer popped since the system booted.

HZ: The number of timer ticks per second, is contained in the kernel variable HZ.
The kernel increments jiffies, HZ times every second

Jiffy:
On a kernel with a HZ value of 100, a “jiffy” is a 10-millisecond duration, while on a kernel with HZ set to 1000, a jiffy is only 1-millisecond.

For more info
http://www.linux-mag.com/id/2272 (The Passage of Time)

Wednesday, September 17, 2008

How do log every thing printed on the terminal

Sometimes we just keep working on a terminal and get lost what all we did.
Isn't it good if we can get some kind of logs which can give us all steps we followed.

First thing which comes in mind is the "history" command, but that will not give the standard outputs which we got after running the commands.

So, here is the solution.Use a command called "script".

e.g.

$ script standard_out.txt
Script started, file is standard_out.txt
$ date
Mon Sep 8 07:57:20 IST 2008
$ asdf
bash: asdf: command not found
$ exit
Script done, file is standard_out.txt

To exit you need to press "ctrl+D".

Now lets check the content of "standard_out.txt" file.

$ cat standard_out.txt
Script started on Mon 08 Sep 2008 07:57:10 AM IST
$ date
Mon Sep 8 07:57:20 IST 2008
$ asdf
bash: asdf: command not found
$ exit
Script done on Mon 08 Sep 2008 07:57:38 AM IST

For more information look at the man page of ''script"'.

Labels:

Wednesday, September 3, 2008

Deleting a speical character file

Sometimes we need to delete a special character file, which we can not delete with normal rm command.So here is the solution...delete it with the help inode number.

$find . -inum __inode number from ls -i of the file __ -exec rm {} \;

Labels: