Monday, January 19, 2009

Interesting Articles-1 Linux Filetypes

Hi Readers,
This time we will understand the File types in Linux.
Linux File Types:
Regular files:
As the name implies; used for data, executables programs, and anything else you might like. In an 'ls -l' listing, they show up with a '-' in the first character of the permission (mode) field.

Directories:
Special files for assiciating file names with inodes. In an 'ls -l' listing they show up with a 'd' in the first character of permissions field.

Symbolic links:
In an 'ls -l' listing, they show up with an 'l' in the first character of the permission field.

Devices:
Files representing both physical hardware devices and software pseudo-devices. There are two kinds:
Block Devices:
Devices on which I/O happens in chunks of some fixed physical record size such as disk drives and tape drives. Access to sch devices goes thruough the kernels buffer cache. In an 'ls -l' listing, they show up with a 'b' in the first character of the permissions field.
Character Devices:
Also known as raw devices. Originally, character devices were those on which I/O happened a few bytes at a time, such as terminals. However, the character device is also used for direct I/O to block devices such as tape drives and disk drives bypassing the buffer cache. In an 'ls -l' listing, they show up with a 'c' in the first character of the permissions field.

Named Pipes:
Also known as FIFO files. These special files acts as pipes; data written into them by one program can be read by another; no data go to or from the disk. FIFOs are created with the mkfifo command. In an 'ls -l' listing, they show up with a 'p' in the first character of the permissions field.

Sockets:
Similar in purpose to named pipes, they are managed with the socket interprocess communication (IPC) system calls. In an 'ls -l' listing, they show up with a 's' in the first character of the permissions field.

Search Google

Books that I refer to...

  • The Complete Reference C, Fourth Edition
  • The C Programming Language