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

Author: Abhilash

Hey! My name is Abhilash - A Ruby developer for years, specialised on web programming, working as a freelancer. Mainly working on Ruby On Rails platform since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I work. You can contact me here: abhilash.amballur@gmail.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s