Why is [folder”] called [directory] in Linux?

888u

Last update at :2024-05-22,Edit by888u


Source: itsfoss.com/folder-directory-linux/


If you're starting out with a Windows computer, you'll most likely use the term "folder."

But when you switch to Linux, you'll find that folders are often called "directories."

This may confuse some new Linux users. Should you call it a folder or a directory? Are they different?

Here's the thing. You can call it a folder if you like, or a directory if you like. It makes no difference.


But if you're wondering why folders are called directories in Linux, here are some explanations.

Before I explain, let's review the real-world uses of folders and directories.

In reality, a folder (envelope) can be used to hold several files (or other items). Catalogs can be used to maintain an index of projects so you can find which project is located where.

Now, let's go back to the table of contents. The term has been around since before Linux even existed. It comes from the UNIX era. Linux inherits many things from UNIX, and this is just one of them.

Now let me tell you something that may surprise you. Directories don't actually put files in them. A directory is a "special file" that knows where files are in storage (via inodes).

This explains why it is called a directory. Directories are used to store an index of items, rather than the items themselves. Directories in Linux and UNIX do not save the files within them. They simply record the location of the file.


So why is it called a folder? In my opinion, it's a matter of perspective. When you're in a graphical environment, you visualize things. Here, files can be visualized like pages, which are stored in an envelope (folder).

When operating systems started using graphical elements, I think some terminology changed accordingly, Directory -> Folder being one of them.


Should you call it a folder or a directory?

It's entirely up to you. You can use both terms as you like.

However, if you are learning the Linux command line or use it regularly, it might be a little helpful to use the term directory.

There are some Linux commands like mkdir, rmdir, etc. where the term "dir" gives a hint that these commands are related to a directory.

Likewise, many Linux commands and bash scripts use the options -d for directories and -f for files.

Even file properties in the terminal differentiate between files and folders (directories) by prefixing the directory with the letter "d".

Take this example, I have a file named some and a folder/directory named something. Note how various Linux commands use "dir" or "d" to differentiate between files and directories.

All of this makes me think that it would be beneficial to use the term "directory" when using Linux commands. Your subconscious mind will more easily associate "dir" and "d" with directories.

Again, whether you want to call it a folder or a directory is entirely up to you. People will understand what you mean.

I just did some analysis on the historical origins of the word directory, which should give you some hints as to why people say "In Linux/UNIX, everything is a file".


Recommended site search: domain name registration price, mainland China virtual host, website server, domain name registration center, mainland China permanent free cloud server recommended cpanel space, 100m free space, how to buy virtual host, German server, Filing on behalf of others,

Why is [folder”] called [directory] in Linux?

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码