Friday, May 22, 2009

Unix: Time access of a File

ctime, atime, and mtime

It is important to distinguish between a file or directory's change time (ctime), access time (atime), and modify time (mtime).

ctime -- In UNIX, it is not possible to tell the actual creation time of a file. The ctime--change time--is the time when changes were made to the file or directory's inode (owner, permissions, etc.). The ctime is also updated when the contents of a file change. It is needed by the dump command to determine if the file needs to be backed up. You can view the ctime with the ls -lc command.

atime -- The atime--access time--is the time when the data of a file was last accessed. Displaying the contents of a file or executing a shell script will update a file's atime, for example. You can view the atime with the ls -lu command.

mtime -- The mtime--modify time--is the time when the actual contents of a file was last modified. This is the time displayed in a long directoring listing (ls -l).

In Linux, the stat command will show these three times.

Examples

$ cat file
file's atime is updated.

$ chmod g+w file
file's ctime is updated.

$ echo "File contents" > file
file's ctime and mtime are updated.

Source

Friday, May 15, 2009

Humour: Geeky Jokes I Came Across

Einstein vs. Newton

Once all the scientists die and go to heaven…………
They decide to play hide-n-seek………

Unfortunately Einstein is the one who has the den………..
He is supposed to count upto 100…and then start searching…..
Everyone starts hiding except Newton………
Newton just draws a square of 1 meter and stands in it rightin front of Einstein………..
Einsteins counting……
97,98,99…..
100……..

He opens his eyes and finds Newton standing in front……..
Einstein says “newtons out..newtons….out…..”
Newton denies and says i am not out……..
He claims tht he is not Newton……
All the scientists come out and he proves tht he is not newton……….
HOW?????????……………..

….scroll down……… further…………..

further…

further..

His proof:
Newton says:
I am standing in a square of area 1m square…..
That means i am Newton per meter square……Hence i am Pascal….since newton per meter
square = Pascal [via]