Linux equivalent of Windows Registry

58

6

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

Posted 2011-06-10T21:24:42.510

Reputation: 1 035

Do you remember the days before the Windows registry (oh, happy days!)? Each program wrote its own data to an .INI file in its own directory, just like Linux/Unix – Mawg says reinstate Monica – 2019-11-18T11:32:24.877

Answers

54

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

Posted 2011-06-10T21:24:42.510

Reputation: 8 755

@Keith, You can write registry keys and values that hold meta data... – Pacerier – 2017-07-29T10:56:34.723

And some programs (Eclipse, Oracle JRE, NodeJS) have the nerve to create folders and files starting with dot in %userprofile% on windows. – Pacerier – 2017-07-29T12:05:38.010

@uSlackr please, you can put it any example so i will proper understand.Thanks – Chetan Bhagat – 2019-04-06T06:12:17.787

Please provide me any other link to helpful.you can put it any example so i will proper understand. – Chetan Bhagat – 2019-04-17T08:55:11.273

5We 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 – 2011-06-11T09:01:23.303

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 – 2011-06-11T10:00:31.177

12Not sure about "frowned upon" but it is regularly done. Most MS programs and many 3rd party store config data there. – uSlackr – 2011-06-11T13:26:04.443

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.

– user1686 – 2011-06-11T19:01:30.993

Heh... so Linux essentially does what the Windows Registry was designed to prevent? – Iszi – 2013-12-11T19:38:50.683

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)

Let_Me_Be

Posted 2011-06-10T21:24:42.510

Reputation: 1 364

1I 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 – 2015-01-16T22:14:35.243

28I 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 – 2011-06-10T21:36:10.207

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. – Let_Me_Be – 2011-06-10T22:00:13.723

7@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 – 2011-06-10T22:10:54.543

4saying 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 – 2011-06-10T22:14:00.657

12@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. – user1686 – 2011-06-10T22:22:36.900

@grawity Sorry, but API to a proprietary library is not a documentation for the format. It is what it is, an API. – Let_Me_Be – 2011-06-10T22:46:26.480

@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. – Let_Me_Be – 2011-06-10T22:49:36.527

7

@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 is not entirely a secret. (leaves the flamewar)

– user1686 – 2011-06-10T23:03:18.207

4A 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 – 2011-06-11T01:23:45.607

@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 – 2011-06-11T04:00:39.213

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 – 2011-06-11T04:14:11.733

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 – 2011-06-11T08:12:29.460

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.) – user1686 – 2011-06-11T08:44:18.517

@grawity As far as I know reverse-engineering is illegal world-wide. It definitely is in Europe. – Let_Me_Be – 2011-06-11T09:32:08.777

2@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 – 2011-06-11T19:47:06.260

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 – 2011-06-11T19:49:14.140

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 – 2011-06-11T19:51:39.227

@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 – 2011-06-11T19:56:07.260

2

@kizzx2: I could legally reverse engineer a Volcano vaporizer 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 – 2011-06-11T20:14:27.260

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

Posted 2011-06-10T21:24:42.510

Reputation: 311

Might want to mention .*rc files in the user's home directory. /etc is just the system-wide stuff. – Mike DeSimone – 2011-06-11T04:09:59.177

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.

user1686

Posted 2011-06-10T21:24:42.510

Reputation: 283 655

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

Posted 2011-06-10T21:24:42.510

Reputation: 27 121

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.

jonny rocket

Posted 2011-06-10T21:24:42.510

Reputation: 1

1Please reread the question. This does not address what was asked. – fixer1234 – 2019-11-18T03:12:25.043

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

Posted 2011-06-10T21:24:42.510

Reputation: 267

-1

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

Posted 2011-06-10T21:24:42.510

Reputation: 21

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 for suggestions. You can then [edit] this.

– a CVn – 2016-07-31T14:11:37.310

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 – 2017-04-04T09:22:45.740

-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

Posted 2011-06-10T21:24:42.510

Reputation: 11

2Hello 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 – 2013-12-11T19:50:59.783