Sunday, March 29, 2009

Twitter interview questions - Operation Engineer-Search

Twitter interview questions - Operation Engineer-Search

How to check the files been created within last hour

How to check the largest file in the directory

How to do recursive copy?

How to scp to multiple machine

What is a command for storing the output of tcpdump in ASCII format

Difference between du and df

ssh on different port

what is find ?

Perl : How to find the most repeated IP address from the Textfile

Friday, March 27, 2009

Difference between du and df

du - disk usage statistics
df - free disk space.

In some cases it is possible that there is a difference between the outcome of df and du.

In 99.9% of the cases this is caused by a lock on the file system. Meaning, if an application opens a file or files and an other application deletes these files while they are opened they will still be calculated by df.

The df command calculates this by looking at the inode table and the inode table has not yet released those files, meaning that, according to the inode table, the files are still using space on the disk.

Generally the solution is to stop/start the process that has a lock on those non existing files and the results returned by df and du will be the same again.