Friday, August 13, 2010

UNIX file system : An Overview

A file is nothing more than a collection of data. Here describes a set of commands.

The command 'od' prints a visible representation of a file. The '-c' option is for interpreting bytes as characters. '-b' for printing the bytes as octal numbers.

$od -c file_name
$od -b file_name

The 'file' command guesses the type of the file. 'od' command with no option dumps the file in 16 bit words.

$od file_name
$file file_name



The command 'du' (disc usage) is to display the disc usage that consumed by the files in that directory. The -a option is for displaying all including the files in a directory. To search a specific file, the output is piped through grep.

$du
$du -a
$du -a | grep file_name

A directory consists of 16 byte chunks, the last 14 bytes of which hold the file name padded with ascii NULs. The first two of which tell the system where the administrative information resides.

The 'find' command finds the file specified.

$find file_name

No comments:

Post a Comment