In this post, we will learn what is the major difference between directory and file.

In Linux, everything is a file.

You cannot have a directory and a file of the same name (regardless of extension), just like you cannot have two files of the same name.

A directory is just a file, too.

Difference between directory and file

The difference is that a directory can contain other files. It does not matter how it is called, it can have an extension (or two). What makes it a directory is that it was created as such.

A directory is one (of many) types of special file. It doesn’t contain data. Instead, it contains pointers to all of the files that are contained within the directory.

source:

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here