What is directory file in linux

What Is a DIRECTORY File?

Tim Fisher has more than 30 years’ of professional technology experience. He’s been writing about tech for more than two decades and serves as the SVP and General Manager of Lifewire.

  • File Types
  • Apps
  • Windows
  • MS Office
  • Linux
  • Google Drive
  • Backup & Utilities
  • Design
  • Cryptocurrency

What to Know

  • A DIRECTORY file is a KDE folder parameters file.
  • Linux systems use this file with KDE (K Desktop Environment).

This article explains what a DIRECTORY file is and how to open one on your computer.

What Is a DIRECTORY File?

A file with the DIRECTORY file extension is a KDE folder parameters file, or sometimes called a KDE folder view properties file.

Every folder in a Linux-based operating systems that uses this kind of file will have its own .DIRECTORY file that specifies options for that particular folder, including the name, icon, and other details. They’re hidden by default.

A folder (like one that holds your music collection, images, etc.) is also referred to as a «directory,» but it’s not the same as this file format. You might also think of an archive, like a ZIP file, as a directory file.

How to Open a DIRECTORY File

The operating system using this file type will use it as is—you don’t need to install any third-party programs to open it. In Linux, what opens it is called KDE, which stands for K Desktop Environment.

Illustration of hand using checklist on digital tablet

However, you should be able to use a free text editor to open a .DIRECTORY file to display (and possibly edit) its contents.

Are you trying to open a folder in a terminal or Command Prompt, and not a .DIRECTORY file? In a terminal, use the open command as seen in this Stackoverflow example. See iSunshare’s tutorial if you need help using the start command to open a directory in Command Prompt.

Читайте также:  Grub console boot linux

How to Convert a DIRECTORY File

There shouldn’t be any reason to convert a .DIRECTORY file to another format because it would just make the file unusable, and the folder that was referring to the file would have to make a new one to store its settings.

If you’re wanting to convert a directory (folder) full of files, and not a .DIRECTORY file, there are a variety of free file converters. You can use them to convert images, audio files, videos, and more.

Something a little different that you might be after is converting a directory listing to a text file so that you can have a list of all the files that are in that folder. This can be done in Windows with the dir command.

Lots of programs can convert a directory of files to the ISO format: WinCDEmu, MagicISO, and IsoCreator are just a few examples. Similar are file compression utilities like 7-Zip and PeaZip that can convert folders to ZIP, RAR, 7Z, and other similar formats.

Still Can’t Open It?

If your file doesn’t open with the suggestions from above, double-check the file extension to make sure it actually reads as «.DIRECTORY» and not something similar like «.DIR.» Files with the .DIR suffix are movies that open with the now discontinued Adobe Director software, and are not at all related to DIRECTORY files.

Another example is Rich Text Format Directory files that use the RTFD file extension. These are text files used on macOS that might contain images, fonts, and other files like PDFs, but they, too, aren’t related to DIRECTORY files, and instead open with Apple’s TextEdit program, Bean, or theLibrarian.

In a desktop environment, right-click and drag a file and select the copy option from the context menu. Another option is to use the cp command to copy files in Linux. Use this syntax: cp source file destination.

Use the command line and mkdir to create new directories in Linux. Open the terminal window > navigate to the folder where you want to place a new directory > and type mkdir directory name.

Use the mv command to move files. Open the terminal window > bring up the file you want to move > and then type mv source file destination.

Источник

Читайте также:  Открыть linux раздел windows

Folder or Directory? Here’s Why Folders are Called Directories in Linux

When you switch to Linux, you find that folders are often termed as directories. Should you call it a folder or a directory? Is there even a difference?

If you start using computers with Windows, you are likely to use the term folder. But when you switch to Linux, you’ll find that folders are often termed as directories. This may confuse some new Linux users. Should you call it a folder or a directory? Is there even a difference? Here’s the thing. You can call it a folder if you want or a directory if you like. It won’t make a difference. But if you wonder why a folder is called a directory in Linux, here is some explanation.

Why is a folder called a directory in Linux?

folder directory

Before I explain that, let’s recall what a folder and directory are used for in the real world. A folder (envelope) can be used to keep several files (or other items) in it. A directory can be used to maintain an index of items so that you can find which items is located where. Now, let’s go back to directory. The term existed even before the existence of Linux. It is coming from the UNIX era. Linux inherits a lot of things from UNIX and this is just one of those many things. Now let me tell you something that may surprise you. A directory does NOT really keep files inside it. Directory is a ‘special file’ that knows where (the content of) a file is stored in the memory (through inode). This makes sense why it is called directory. A directory keeps the index of items, not necessarily the items themselves. The directories in Linux and UNIX don’t keep the files inside them. They just have the information about the location of files. If you want to learn more about it, my article on hard links should help you. So, why is it called a folder then? To me, it comes from the perspective. When you are in a graphical environment, you visualize things. Here, files can be visualized like pages and those file pages are stored in an envelope (folder). When the operating systems started using graphical elements, I think some terms were changed accordingly and directory-folder was one of them.

Читайте также:  Find как работать linux

Should you call it folder or directory?

file directory commands difference

That’s entirely up to you. You can use either term at your convenience. However, if you are learning Linux command line or use it often, using the term directory could be a tad bit more helpful. There are Linux commands like mkdir, rmdir etc. The term ‘dir’ gives a hint that these commands have something to do with directories. Similarly, many Linux commands and bash scripts will use option -d for directories and -f for files. Even the file properties in the terminal distinguish between files and folders (directories) by putting the letter d in front of the directories. Take this example where I have a file names ‘some’ and a folder/directory named ‘something’. Notice how various Linux commands distinguish between file and directory with ‘dir’ or ‘d’. All this makes me think that using the term ‘directory’ will be beneficial while using Linux commands. It would be easier for your subconscious mind to relate the terms ‘dir’ and ‘d’ with directory. Once again, it’s entirely up to you if you want to call it a folder or directory. People would understand what you are referring to. I just gave some insight into the historical origin of the term directory and this should give you some hint on why people say ‘everything is a file in Linux/UNIX’. Now that I end my ramblings, I invite your comment on it. If you find any technical inaccuracies, let me know, please.

Источник

Оцените статью
Adblock
detector