66

What is the Linux equivalent of Windows Registry? If there is no equivalent or similar structure in Linux, how are the things that are done by the Windows Registry handled in Linux?

serena
  • 1,115
  • 3
  • 11
  • 16

10 Answers10

62

Linux applications typically store their config in a text-based file specific to the application. Machine specific configs are typically stored in the /etc directory tree. User specific settings are typically in the users' home directory and often in "hidden" files that start with a "." (use 'ls -a' to see them).

uSlackr
  • 8,955
  • 31
  • 48
  • 5
    We could also add that those text files are human readable and often include comments in them that describe the particular configuration item. So the documentation is often right there in front of you when you need to change something. You can add your own notes as well, for example why you changed something. The Windows registry holds no such "metadata". – Keith Jun 11 '11 at 09:01
  • 1
    Surely this answer is flawed because the purpose of the registry Is not to hold settings but to register components such as dlls and shell extensions with the operating system. Storing program configuration in there Is a frowned upon technique. – Adam Casey Jun 11 '11 at 10:00
  • 12
    Not sure about "frowned upon" but it is regularly done. Most MS programs and many 3rd party store config data there. – uSlackr Jun 11 '11 at 13:26
  • 7
    @Dotmister: That was its purpose indeed... in the days of Windows 3.1. Starting with 32-bit Windows (95 and NT), the Registry became a [database for configuration data](http://msdn.microsoft.com/en-us/library/ms724871.aspx). – u1686_grawity Jun 11 '11 at 19:01
  • 1
    Heh... so Linux essentially does what the Windows Registry was designed to prevent? – Iszi Dec 11 '13 at 19:38
  • @Keith, You can write registry keys and values that hold meta data... – Pacerier Jul 29 '17 at 10:56
  • And some programs (Eclipse, Oracle JRE, NodeJS) have the nerve to create folders and files starting with dot in %userprofile% on windows. – Pacerier Jul 29 '17 at 12:05
  • @uSlackr please, you can put it any example so i will proper understand.Thanks – Chetan Bhagat Apr 06 '19 at 06:12
  • Please provide me any other link to helpful.you can put it any example so i will proper understand. – Chetan Bhagat Apr 17 '19 at 08:55
11

/proc for kernel related stuff

/etc for software related stuff

Gnome config can be considered similar to Windows Registry as well.

But since Linux and Windows core philosophies are diametrically different (Linux ~ open and compatible, Windows ~ closed and obstructive), there is no direct parallel.

Edit: for those who disagree, here is a bit of history for you: http://www.faqs.org/docs/artu/ (awesome reading, no matter what your background is)

MaxD
  • 29
  • 10
Šimon Tóth
  • 1,414
  • 2
  • 17
  • 29
  • 32
    I don't see what software design philosophy has to do with the particularities of specific implementations of configuration storage. The reason there isn't a direct parallel is because they're fundamentally different architectures, not just because Microsoft hates freedom. – Shinrai Jun 10 '11 at 21:36
  • 8
    @Shinrai The fundamental design philosophy of Unix (and Linux) is using standardized text formats. Windows Registry is a proprietary binary format. "Microsoft hates freedom" is totally out of context here. Windows was designed to be as much incompatible with Unix as possible and ignored all possible international standards (while creating it's own). This is old history, but this is where Windows registry comes from. – Šimon Tóth Jun 10 '11 at 22:00
  • 8
    @Let_Me_Be - I'm sorry, your wording read me to think that you meant "Open source is the best! Microsoft is evil incarnate!" like so many *nix fanatics on the web, rather than a discussion of the literal format of the content. Comment withdrawn, but you might reword to be a little clearer since a few people seem to have read it just like I did. (I think 'obstructive' especially gives the wrong impression here.) – Shinrai Jun 10 '11 at 22:10
  • 4
    saying that part of the Windows philosophy is to be obstructive doesn't seem particularly accurate. while it is true that MS does not allow free access to the Windows source code they (generally) do not attempt to block users or developers from using Windows as they want. – Xantec Jun 10 '11 at 22:14
  • 16
    @Let_Me_Be: _Standartized_ text formats? You must be joking. Windows sucks in many ways, but a common Registry API is one thing it does well. – u1686_grawity Jun 10 '11 at 22:22
  • @grawity Sorry, but API to a proprietary library is not a documentation for the format. It is what it is, an API. – Šimon Tóth Jun 10 '11 at 22:46
  • @Xantec It is not (and never was) about the source. There are many proprietary Unixes, some of the are still being actively used (OSX, AIX, QNX, ...). It is about documented open formats and international standards. – Šimon Tóth Jun 10 '11 at 22:49
  • 9
    @Let_Me_Be: The word was "standartized", not "documented". I'd rather distribute one `.reg` file (or `.ini`, `.xml`, `.json`, whatever you wish) over X machines than have to regexp the hell out of twenty different config files in `/etc/` while trying to change network-wide settings but retain unrelated local additions... while you won't find perfectly detailed explanation for Windows registry hives, [their structure](http://sentinelchicken.com/data/TheWindowsNTRegistryFileFormat.pdf) [is not entirely a secret](http://technet.microsoft.com/en-us/library/cc750583.aspx). *(leaves the flamewar)* – u1686_grawity Jun 10 '11 at 23:03
  • 5
    A standardized (and sufficiently flexible) API or format for configuration is good; a unified database for them is debatable (pros *and* cons, afterall). Unix's problem however, is not the lack of a standard it is (as usual) the proliferation of standards. – dmckee --- ex-moderator kitten Jun 11 '11 at 01:23
  • @Let_Me_Be It might be a bit pedantic to point this out, but the "unix" part of OSX is open source: http://www.opensource.apple.com/ – ghoppe Jun 11 '11 at 04:00
  • One detail I'd like to point out: `/proc` is ephemeral. Its contents are created on the fly, and setting changes made to it are lost on reboot. `/etc`, on the other hand, is a regular directory containing regular files. Finally, there's `/sys`, which is intended to be primarily machine-readable and shows system-related things such as driver parameters and connected devices. – Mike DeSimone Jun 11 '11 at 04:14
  • 1
    @grawity He did not say Unix is better than Windows. He said Unix is _open and compatible_ while Windows _closed and obstructive_, which you baiscally agreed -- the API is undocumented, so it's closed (no freedom). I think _obstructive_ as the opposite of _compatible_ **as it is used here** means the format cannot be made easily compatible by third parties. Given some reasonable text format, you are free to implement formats to manipulate it. Whereas given a binary blob of registry, you are locked in to MS's implementation. I guess the later part is getting pedantic and nitpicking. – kizzx2 Jun 11 '11 at 08:12
  • 1
    @kizzx2: s/the API/the format/; s/implement formats/implement APIs/; also, while I agree it is "closed" and all that, I wouldn't call it "obstructive", as the format merely is undocumented but doesn't actively prevent reverse-engineering and such. (There *are* softwares that do that, such as Skype.) – u1686_grawity Jun 11 '11 at 08:44
  • @grawity As far as I know reverse-engineering is illegal world-wide. It definitely is in Europe. – Šimon Tóth Jun 11 '11 at 09:32
  • 4
    @Let_Me_Be: It most certainly is not. Otherwise Samba, WINE, ReactOS, OpenOffice, and Dalvik wouldn't exist, and we'd still be using IBM PCs. – Patches Jun 11 '11 at 19:47
  • 1
    @grawity "doesn't actively prevent reverse-engineering and such". Maybe it's just me, I find it totally fitting to call something that suggests reverse engineering for third parties and treading law's water, _obstructive_. – kizzx2 Jun 11 '11 at 19:49
  • 1
    @Patches, Let_Me_Be Yeah and the famous example of NTFS on *nix. It took about a decade for it to fully mature (ntfs-3g), it's done by reverse engineering. Now _that's_ pure obstruction. – kizzx2 Jun 11 '11 at 19:51
  • @Patches Thinking about it, I wouldn't make such a bold assertion as "reverse engineering certainly is not illegal." IANAL (maybe you are, in that case I'm just making a fool of myself :P). But look at Mono. There are lengthy debates on whether MS could "pull the plug" on Mono (see Wikipedia), and Mono is not even "reverse engineering". – kizzx2 Jun 11 '11 at 19:56
  • 2
    @kizzx2: I could legally reverse engineer a Volcano [vaporizer](http://en.wikipedia.org/wiki/Vaporizer_(cannabis)) and still face charges for possession of drug paraphernalia. The simple fact that reverse engineering is legal certainly doesn't absolve you from other relevant laws, but those laws don't make reverse engineering itself illegal. – Patches Jun 11 '11 at 20:14
  • 1
    I don't think Microsoft just hates freedom, they just follow a different money making business model. Over the years they had the sharpest macheti in the "cut-throat" business, but others have also caught up and learned sharpening theirs better. And I consider Windows VS Linux debate silly and waste of ones precious time. – Ostati Jan 16 '15 at 22:14
  • Link is dead, where should I find the new one? Is there a topic name of the link? – Louis Go Sep 09 '20 at 08:07
7

System wide settings are located in files in /etc, per user settings are typically located as hidden files (start w/ a .) in the users home directory. For more information about a specific program see it's man page - man [program name].

daalbert
  • 311
  • 1
  • 3
5

Most applications use text-based configuration files (usually each program has its own format, although some use XML or JSON). System-wide configuration is kept under /etc.

User configuration is usually stored in the user's home directory, in so-called "dot files" (filenames starting with a "."; use ls -a to display them). To avoid "dotfile creep", recently programs have started keeping their configuration in ~/.config/ per XDG Base Directory specification.

Various desktop environments have their own Registry-like APIs: Gconf (deprecated) and dconf/GSettings (new) in GNOME; Xfconf in Xfce.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
3

It's split on Linux. There is not one single place.

For programs run by users, it's usually in $HOME/.someprogramrc if it's a file, or $HOME/.somedirname if complicated enough to warrant a subdirectory. KDE apps all find subareas of $HOME/.kde I believe, usually not generating their own dir.

The common action for listing directories is to treat files starting with . as hidden, so you'll need to use ls -A from the command line, or use the show hidden files setting of your gui.

For programs run by the system, it's usually a file someplace in /etc/ There's not a true naming convention in etc, though directories are usually signified by .d at the end.

For the kernel, it's in /etc/sysconfig.conf, or a startup script in /etc/init.d that writes to /proc/sys/*

Most system configs are in /etc to make it easier to back up a system. By holding only config files and not binaries, /etc/ therefore tends to be small.

Rich Homolka
  • 31,057
  • 6
  • 55
  • 80
1

The equivalent of the registry on Linux is Elektra but it is not very popular. Most software uses a configuration file located in the /etc directory.

https://www.libelektra.org/

Abdallah B
  • 11
  • 1
0

Windows: - Stores the data in files within the directory hierarchy - These files are like the mentioned .dll and other supporting files - Then the files are managed through management systems like databases (the Registry) to provide easier interaction with the user(s). - This means we point and click, but TONS of data is recorded in the background for ease of use, faster accessibility and unnecessary data storage in the name of easier usage.

Linux: - Files are stored in the separated partitions (we have to remember, in Linux, we can access hardware more directly, including the screen - everything is accessible through the CLI). - These files are in the directory hierarchies already in place (in the storage system of the OS, similar to Windows but not just separated by folders) - The files are more readable, easier to access, but they require the knowledge of the CLI's to be able to utilize them.

Primary Difference: Windows adds the databases "layer" to the OS interface to manage the interactions from the user, system, etc. This makes it "easier" to utilize the GUI to access and perform everything, but it also makes the user and system highly dependent on this database system for most functionality. Linus on the other hand, allows direct interfacing with the components, meaning you are having to know the "language" to type in lieu of the Windows point-and-click methods. Yes, you can utilize a CLI through Windows, but then you are not truly comparing the Windows to Linux comparison. The differences are in how the user accesses the data, how the system utilizes the data, and how Windows simply adds more "management" (by the system) to produce an "easier" interface than knowing your way around a command line.

It is an understandable comparison to assess as someone new to the CLI/Linux environment, but it makes a lot more sense when you apply the intent of both of these systems first. Linux is not "subverting the attempts Microsvck has made with the integration of a Registry", it is giving the user more power by eliminating layers of abstraction between the user and the hardware.

To imagine this, think of a typewriter. You press the keys, they move the gears and you hammer the ink to paper producing data. In Linux, a user enters commands to interface with the system kernel to perform actions in the hardware. In a Windows environment, you have more potential layers between the user and the hardware. Applications can invoke commands which communicate with the OS, which interfaces with the system/kernel, which then works with the hardware. This process becomes more complicated in Windows as more variables enter the equation, like the commands having to interact with the Registry to retrieve information prior to being able to execute things... and this is why Windows uses more resources to run, do basic and complex tasks. Preloaded services and processes are loaded to allow management of functions that Linux would require the user to invoke. And yes, there are processes that run in Linux, but I am trying to just give a basic idea of how the systems differ to better display why some other comments have been inaccurate. The idea of using Linux is to minimize the interfaces between user and hardware, keeping things simpler with much less clutter. Windows tailors to the users and tries to encompass more functionality in a more easily accessible way, but it comes at the cost of complex management systems (that can easily become cluttered and problematic). The Registry can also provide a digital trail of all physical connections and other physical interactions with hardware that is just saved and saved (unless cleaned by a user/program). I'd prefer to have readable files that I can manually delete when not used, compared to cleaning the various/many spots needing regular cleaning in Windows (and potentially risking BIG problems b/c of the Registry). It is just another layer to manage things behind the scenes and establish more of a digital trail that the user gets stuck storing.

Unfortunately, many users are conditioned to Windows and are too fearful of Linux prior to trial. There are so many flavors, some having differing commands, shells, etc. which becomes difficult to choose as a beginner. Once we remove our "Windows conditioning", it becomes clearer that Linux distros are superior in many ways (w/o the bloated software). The only scenario I personally feel Windows is superior for is playing games. It becomes more disturbing as MS pushes more to unify to 1 OS at a time, always wanting to get more data from you. It is a good skill to have, and playing with a Linux distro can potentially answer these questions for new users reading these posts.

Mike Hawk
  • 31
  • 1
  • 3
    This reads like a rant rather than an answer. It is doubtful whether it even tries to actually answer the question as asked. It is also outright *wrong* in several places. (Files in Linux stored on separate partitions? Files in Linux requires knowledge of the CLI to access? Linux eliminating hardware abstraction compared to Windows? Linux users interacting directly with the kernel? Really, WTF?) I encourage you to take the site [tour] to learn how we do things and to read through [How do I write a good answer](https://superuser.com/help/how-to-answer) for suggestions. You can then [edit] this. – user Jul 31 '16 at 14:11
  • 1
    @MichaelKjörling: although you are right about the quality of this answer, it contains one thing which is very important: the Windows registry (regedit program) is one application, showing the internals as if they were stored within one configuration database, while indeed those files are spread all over the PC. This transforms the original question into "Is there a Linux tool which gives a summary of the overall configuration of the machine, something like regedit in Windows?" – Dominique Apr 04 '17 at 09:22
0

https://en.wikipedia.org/wiki/Windows_Registry - The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interface can all use the registry. The registry also allows access to counters for profiling system performance.

In simple terms, the registry or Windows Registry contains information, settings, options, and other values for programs and hardware installed on all versions of Microsoft Windows operating systems. For example, when a program is installed, a new subkey containing settings such as a program's location, its version, and how to start the program, are all added to the Windows Registry.

When introduced with Windows 3.1, the Windows Registry primarily stored configuration information for COM-based components. Windows 95 and Windows NT extended its use to rationalise and centralise the information in the profusion of INI files, which held the configurations for individual programs, and were stored at various locations.[1][2] It is not a requirement for Windows applications to use the Windows Registry. For example, .NET Framework applications use XML files for configuration, while portable applications usually keep their configuration files with their executables.

0

There is no Registry in linux. But you should take a look at gconf-editor and dconf-editor ... and also hidden files/folders inside your home directory (with names starting with dot), mostly plain (TXT) files containing some configuration for a specific program.

saeedgnu
  • 488
  • 2
  • 5
  • 11
-1

The Windows registry was created to automate the various .ini and other configuration files for operating system and programs so that it would load faster. All of the information in the registry is also contained elsewhere in the computer but today they are usually write protected. Linux uses Vi (visual editor) or other editor to access these configuration files in Linux to edit them.

builder7
  • 11
  • 1
  • 2
    Hello and welcome to superuser.com. Although I believe what you are trying to tell the poster is correct, it does not come out very well in your answer. Unless you have a decent understanding of how Linux and Windows work, I believe it is difficult to understand what you are trying to get at. Please rethink and rewrite your answer so that anybody can understand it. – Mogget Dec 11 '13 at 19:50