File in Linux Operating System-Overview

[et_pb_section fb_built=”1″ _builder_version=”3.19.9″][et_pb_row _builder_version=”3.19.9″][et_pb_column type=”4_4″ _builder_version=”3.19.9″][et_pb_text _builder_version=”3.19.17″]

Linux looks at everything as a File, if something is not a File, then it is a Process.

Any Linux file systems will have many files. If you write a program, you add one more file to the system. When you compile it, you are adding at least two files in the system.

The most notable feature of the Linux file system is that Linux makes little distinction between various types of files.

[/et_pb_text][et_pb_text _builder_version=”3.19.17″]

There are three types of files in the Linux File System.

  • Ordinary / General Files – Contains only data.
  • Directory Files – Contains other files and directories.
  • Device Files – Represents all hardware device.

∗ A Linux file doesn’t contain the end-of-file mark or its name.

[/et_pb_text][et_pb_code _builder_version=”3.19.17″] style=”display:block; text-align:center;” data-ad-layout=”in-article” data-ad-format=”fluid” data-ad-client=”ca-pub-1750980986506231″ data-ad-slot=”3802595016″>[/et_pb_code][/et_pb_column][/et_pb_row][et_pb_row _builder_version=”3.19.17″][et_pb_column type=”4_4″ _builder_version=”3.19.17″][et_pb_text _builder_version=”3.19.17″]

Ordinary File

This is the traditional definition of a file. You can put anything you want into this type of file. It includes all data, documents, source codes, objects, and executable code.

Commands like cat, ls, touch etc are treated as an ordinary file. The most common type of ordinary files is the text file.

[/et_pb_text][et_pb_text _builder_version=”3.19.17″]

Directory File

A directory contains no external data but keeps some details of the files and sub-directories that it contains. A directory contains two fields for each file – the name of the file, and its identification number ( inode ).

You can create a directory by typing this command – mkdir dir_name

Ex- in a terminal, type ” mkdir sayan ” ( without the quote ), it will create a directory named ” sayan “.

∗ It is the directory file that contains the names of all files resident in the directory.

[/et_pb_text][et_pb_code _builder_version=”3.19.17″] style=”display:block; text-align:center;” data-ad-layout=”in-article” data-ad-format=”fluid” data-ad-client=”ca-pub-1750980986506231″ data-ad-slot=”3802595016″>[/et_pb_code][et_pb_text _builder_version=”3.19.17″]

Device File

Linux considers physical devices as files too. This includes printers, tapes, floppy drives, Hard Disks, Bluetooth etc.

The device file is special in the sense that any output directed to it will be reflected onto the respective physical device associated with the filename.

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row _builder_version=”3.19.17″][et_pb_column type=”4_4″ _builder_version=”3.19.17″][et_pb_image src=”https://tec4tric.com/wp-content/uploads/2019/02/file.png” align=”center” _builder_version=”3.19.17″][/et_pb_image][et_pb_text _builder_version=”3.19.17″]

As you can see the color codes, the Blue texts represent it is a Directory, the Black texts represent it is an ordinary file, and the Green one represents it is an executable file.

[/et_pb_text][et_pb_code _builder_version=”3.19.17″] style=”display:block; text-align:center;” data-ad-layout=”in-article” data-ad-format=”fluid” data-ad-client=”ca-pub-1750980986506231″ data-ad-slot=”3802595016″>[/et_pb_code][et_pb_pricing_tables _builder_version=”3.19.17″ header_font=”||||||||” header_text_align=”center” header_font_size=”38px” body_font=”||||||||” body_font_size=”22px” subheader_font=”||||||||” currency_frequency_font=”||||||||” price_font=”||||||||” text_orientation=”left”][et_pb_pricing_table title=”Symbol” _builder_version=”3.19.17″ header_font=”||||||||”]

 + –

d

l

c

s

p

b

[/et_pb_pricing_table][et_pb_pricing_table title=”Meaning” _builder_version=”3.19.17″]

Regular file

Directory

Link

Special file

Socket

Named pipe

Block device

[/et_pb_pricing_table][/et_pb_pricing_tables][et_pb_post_nav in_same_term=”off” _builder_version=”3.19.17″ title_font=”||||||||” title_text_color=”#0c71c3″ title_font_size=”17px”][/et_pb_post_nav][/et_pb_column][/et_pb_row][/et_pb_section]

Sayan De

Sayan De is pursuing his M.Tech in CSE. His interest area of work is Machine Learning, Deep Learning, Deep NLP, Computer Vision, Data Science, Linux, and a little bit of Website Development.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.