Command Line Interface (CLI), Terminal, Shell, TTY
Command Line Interface (CLI)
Command line interface, in layman’s terms, is the kind of interface that you have seen with characters all over the screen. Command line interface (English: Command-line Interface, abbreviation: CLI) is the most widely used user interface before the popularity of graphical user interface, it usually does not support the mouse, the user through the keyboard input commands, the computer receives the command, to be executed.
In today’s graphical user interface (GUI) has been completely popular, ordinary users in the process of daily use of the computer almost no manual input any command, most operations can be completed with a click of the mouse, and skilled use of the command line operation seems to have become synonymous with high profile. In fact, there are still many software developers, system administrators, or advanced users using the command line interface to operate the computer. One of the main reasons is efficiency: using the command line interface is often faster than using the GUI, provided that you know the commands well. The high efficiency of command-line operation is the reason why many graphical computer systems still do not give up providing command-line operation. Even Windows has its own cmd.exe and PowerShell command line programs.
Terminal (Terminal): the interface between human and machine interaction
In the computer field, a terminal is a machine that allows the user to input data to the computer and display the results of its calculations. In other words, a terminal is only an input and output device used to interact with a computer, and does not provide computing and processing functions itself. To fully understand terminals, we have to go back in history to see the origin of terminals.
History of terminals
In the days of Mainframes and Minicomputers, computers used to be very expensive and huge, unlike today’s computers. These bulky computers were usually housed in separate rooms, and the people who operated them sat in separate rooms and interacted with them through certain devices. This equipment is called a terminal, also known as a terminal.
Early terminals were generally a device called a Teletype. Why? Because the founders of Unix, Ken Thompson and Dennis Ritchie, wanted Unix to be a multi-user system. A multi-user system meant that each user had to be assigned a terminal, and each user had to have a monitor and a keyboard. But all computer equipment at that time was very expensive (including monitors), and the keyboard was integrated with the mainframe; there was no separate keyboard at all. Then they resourcefully found one thing, which was ASR-33 teletypewriter. Although the original purpose of the teletypewriter was to send and receive telegrams on telegraph lines, it had both a keyboard that could send signals and a paper tape that could print the received signals on, making it perfectly suitable for use as a human-computer interaction device. And most importantly, the price is low. So they connected many ASR-33s to the computer, allowing each user to log in and operate the mainframe at the terminal. In this way, they created Unix, the first true multi-user operating system in the history of computing, and the teletypewriter became the first Unix terminal. Want to know what it’s like to use a teletypewriter as a terminal? Here’s a very cool demo video.
As we said above, historically, a terminal is a peripheral device with input and output capabilities that is connected to a computer. But there is one terminal that is different in that it is integrated with the host computer and is an integral part of the computer. This particular terminal is called a Console. As the name implies, the console is used to manage the host computer and can only be used by the system administrator, with more privileges than a normal terminal. There is usually only one console on a computer, but many terminals can be connected.
In the picture above, Console is on the left and Terminal is on the right.
Nowadays, it may be difficult to understand why there is a distinction between console and terminal, but as mentioned in the previous section, at that time, there were many users accessing a computer through a terminal, and the system administrator who specialized in managing those big machines was someone else. Ordinary users used ordinary terminals, while system administrators used more powerful terminals, so they were called consoles. However, with the popularity of personal computers, the concept of Console and Terminal has gradually blurred. In modern times, our keyboards and monitors can be thought of as both consoles and regular terminals. When you are managing a system, they are consoles; when you are doing general work (browsing the web, editing documents, etc.), they are terminals. We ourselves are both general users and system administrators. Therefore, Console and Terminal are now seen as basically synonymous.
Character Terminal vs. Graphic Terminal
There are also different kinds of terminals. Character Terminal, also called Text Terminal, is a terminal that can only receive and display text information. Early terminals were all character terminals. Character terminals are also divided into Dumb Terminals and so-called Intelligent Terminals, because the latter can understand escape sequences, locate cursors and display positions, and are more intelligent, while dumb terminals cannot.
The VT100, manufactured by DEC in 1978, was an unprecedented success because it was well designed and one of the first intelligent terminals to support ANSI escape sequences and cursor control. VT100 was not only the most popular character terminal in history, but also became the de facto standard for character terminals. the de facto standard. With the advancement of technology, Graphical Terminal also began to appear in the public eye. Graphic terminal can not only receive and display text information, but also display graphics and images. The famous graphic terminals are the Tektronix 4010 series. However, nowadays specialized graphic terminals are extremely rare and they have been largely replaced by full-featured displays.
As computers have evolved, we no longer see dedicated terminal hardware, instead we have keyboards and monitors. But without a terminal, how do we interact with traditional command-line programs that are not compatible with graphical interfaces (like most of the commands in the GNU toolset)? These programs do not read our keyboard input directly, nor do they display the results of our calculations on our monitors.
This is where we need a program to emulate the behavior of a traditional terminal, the Terminal Emulator. Technically speaking, Terminal Emulator should be translated as “terminal emulator”. For those command line (CLI) programs, Terminal Emulator “pretends” to be a traditional terminal device; for modern graphical interfaces, Terminal Emulator “pretends” to be a GUI program. The standard workflow of a terminal emulator is as follows.
- Capture your keyboard input.
- send the input to a command line program (the program will think it is input from a real terminal device).
- get the output of the command line program (STDOUT as well as STDERR).
- call the graphics interface (e.g. X11) and render the output to the display.
There are many terminal emulators, so here are a few classic examples.
- GNU/Linux: gnome-terminal, Konsole
- macOS: app, iTerm2
- Windows: Win32 Console, ConEmu, etc.
In modern times, when specialized terminal hardware has largely survived only in computer museums, people often try to save time and just call terminal emulators “terminals”.
Terminal Window and Virtual Console
Most terminal emulators run in a GUI, but there are exceptions. For example, in the GNU/Linux operating system, pressing Ctrl + Alt + F1,F2…F6 switches to several black full-screen terminal screens, while pressing Ctrl + Alt + F7 switches back to the GUI. Although they do not run in the graphical interface, they are in fact a kind of terminal emulator.
The only difference between these full-screen terminal interfaces and terminal emulators running under a GUI is that they are provided directly by the operating system kernel. These kernel-provided terminal interfaces are called Virtual Console, while the terminal emulators running on the GUI mentioned above are called Terminal Window. Other than that, there is no difference. Of course, since Terminal Windows are running on the GUI, if the GUI goes down, so do they. You can at least switch to Virtual Console to put out the fire, because they are provided directly by the kernel and are generally available as long as the system itself does not have problems.
Simply put, tty is the collective name for terminal. Why? The earliest Unix terminal was the ASR-33 teletypewriter. The abbreviation for Teletype/Teletypewriter is tty, which is where the name tty comes from. Because Unix was designed as a multi-user operating system, people would connect multiple terminals to their computers (at the time, these terminals were all teletypewriters.) To support these teletypewriters, the Unix system designed a subsystem called tty, which abstracted specific hardware devices into device files located in /dev/tty* inside the operating system.
Why abstract a teletypewriter as a hardware device into a “tty device” file? Interested students can learn more about the concept of Everything is a file in Unix operating systems.
With the development of computers, terminal equipment was no longer restricted to teletypewriters, but the name tty stayed that way. Over time, their concepts became confused. So in modern times, a tty device is a terminal device, and a terminal device is a tty device, without distinction. Since the biggest use of the Serial Port on early computers was to connect terminal devices, Unix at the time would similarly abstract the devices on the serial port as tty devices (located in /dev/ttyS*). As a result, it is now common to refer to serial devices as tty devices. In the tty subsystem, concepts such as pty, ptmx, pts, etc. were also derived, so I won’t go into details here.
Shell: The program that provides the user interface
As we all know, the operating system has something called the Kernel, which manages the entire hardware of the computer and is the most basic part of the modern operating system. However, the kernel is at the bottom of the system and cannot be manipulated by ordinary users, otherwise the system will crash if you are not careful. But we still need to let the user operate the system, so how do we do it? This requires a special program that accepts commands from the user, then helps us communicate with the kernel, and finally lets the kernel do our job. This program that provides the user interface is called the Shell (shell layer).
In fact, the shell only provides an entry point to the user’s operating system, and we generally use the shell to call various other applications to achieve our goals. For example, if we want to know the contents of a file, we would type the command cat foo.txt into the shell, and then the shell would run the program cat for us, and then cat would call the system calls provided by the kernel such as open to get the contents of the file. Although it is not the Shell that interacts directly with the kernel, in a broad sense it is the Shell that provides the user interface to interact with the kernel. As for why it is called a shell, just look at the following diagram.
Shells can generally be divided into two types: command line shells, which provide a command line interface (CLI), and graphical shells, which provide a graphical user interface (GUI). explorer.exe under Windows is a typical graphical shell (yes, it is, because it accepts commands from you and will help you interact with the kernel to complete your commands).
Common or historically known command line shells are.
- For Unix and Unix-like systems.
- sh (Bourne shell), the most classic Unix shell.
- bash (Bourne-Again shell), the default shell for most current Linux distributions.
- zsh (Z shell), a more powerful shell than the above.
- fish (Friendly interactive shell), a shell that focuses on ease of use and friendly user experience.
- exe (Command Prompt).
There are also a variety of other shell programs, so I won’t list them all here, if you are interested in searching for them.
The division of labor between the Shell and the terminal
Now we know that the terminal receives input from the user (keyboard, mouse, and other input devices), throws it to the shell, and then presents the results returned by the shell to the user (e.g., through the monitor). The Shell, on the other hand, takes the commands entered by the user from the terminal, parses them, gives them to the operating system kernel for execution, and returns the results to the terminal. However, there is some confusion about the division of labor between the shell and the terminal, which is illustrated by the following example.
- The terminal converts the user’s keyboard input into control sequences (keystrokes other than characters, e.g. left arrow key → ^[[D), while the Shell parses and executes the received control sequences (e.g. ^[[D → move cursor to the left).
- There are exceptions, however, such as when the terminal receives the Ctrl + C key combination, instead of forwarding this key to the current program, it sends a SIGINT signal (which, by default, causes the process to terminate). Other similar special key combinations are Ctrl-Z and Ctrl-, which can be checked with the stty -a command to see the current terminal settings.
- The shell issues commands like “change foreground color to red (control sequence \033[31m])”, “show foo”, etc.
- The terminal receives these commands and does what the shell says, so you see a red foo line output on the terminal
- The Shell never knows the output of the command it executes unless it is redirected. We can page up and down in the terminal window to see past output, which is a feature of the terminal and has nothing to do with the Shell.
- The command prompt (Prompt) is an entirely Shell concept, unrelated to the terminal.
- Line editing, input history and auto-completion are provided by the shell (for example, the fish shell has a very good history of commands and command auto-completion). For example, XShell, a terminal emulator, can write a single line of command locally and send it to a shell on a remote server (useful when the connection is not good, otherwise it takes a long time to type).
- Copy and paste functions in the terminal (Shift + Insert or right mouse button, etc.) are basically provided by the terminal. For example, the default Windows terminal has very poor support for copy and paste, while a different terminal (e.g. ConEmu) can support it very well. However, Shell and other command-line programs can also provide their own copy-paste mechanisms (e.g. vim).
Graphical interface vs. desktop environment
Linux itself does not have a graphical interface, but is itself just a command line based operating system. In Linux, you can type startx in the command line system. x does not mean specific software, it means the protocol. x.org is the server that implements the x protocol, which is equivalent to Apache, Nginx, etc. that implements the HTTP protocol, and various x clients are like different interactive interfaces. The mainstream interfaces are: GNOME, KDE, XFCE and LXDE.
For a user accustomed to Windows, it can be difficult to properly understand the graphical environment of UNIX/Linux, as it has little in common with purely graphical Windows. The system structure and the way it operates are no different from UNIX. To put it simply, you can think of Linux as a special version of a UNIX-like system.
Microsoft Windows in the early days was only a DOS-based application, the user must first enter DOS and then start the Windows process, and from Windows 95 onwards, Microsoft made the graphical interface the default, the command line interface is only opened when needed, and later Windows 98/Me actually belong to the system. However, after Windows 2000, DOS was completely removed and Windows became a fully graphical operating system.
Unlike UNIX/Linux, which always had a powerful command line interface as their foundation, in the mid-1980s, the graphical interface trend swept the operating system industry, and the Massachusetts Institute of Technology (MIT) worked with DEC in 1984 to develop a decentralized Windows environment on UNIX systems, the famous This was the famous “X Window System” project. However, the X Window was not a direct graphical operating environment, but an intermediate bridge between the graphical environment and the UNIX kernel, so that any vendor could develop a different GUI graphical environment based on the X Window. The purpose of MIT and DEC was to design a simple graphical framework for UNIX systems so that more commands could be displayed on the screen of UNIX workstations, and they did not care about the exquisiteness and ease of use of the GUI.
In 1986, MIT officially released X Window, which has since become the standard Windows environment for UNIX. Immediately afterwards, the X Association, which was fully responsible for the development of the project, was established, and X Window entered a new phase. At the same time, many UNIX vendors also developed their own UNIX GUI Windows environment on the X Window prototype, among which the more famous ones were “Open Look” developed by SUN and AT&T, OSF (Open Software Foundation) led by IBM, and the UNIX GUI Windows environment developed by MIT. (Open Software Foundation) under the leadership of IBM developed “Motif”. The free and full-featured X Window soon found its way into commercial UNIX systems and was ported to a variety of hardware platforms, and later Linux benefited directly from the project. Of course, these early X Window environments were designed to be simple, with many GUI elements mimicking Microsoft Windows.
Because it had to be based on the UNIX system, X Window was destined to be an application on UNIX only and could not be highly integrated with the operating system kernel, which made it impossible for an X Window-based graphics environment to run efficiently, but it had the advantage of having a high degree of design flexibility and portability. Server (X Server) mainly handles input/output information and maintains related resources, it accepts operations from keyboard and mouse and gives it to X Client (X Client) to give feedback, while the output information from X Client is also outputted by it; the outermost X Client provides a complete GUI interface and is responsible for direct interaction with users, while The outermost X Client provides a complete GUI interface and is responsible for direct interaction with the user, while the “X Protocol (X Communication Protocol)” bridges the X Server and X Client, and its task is to act as a communication channel between the two. Although UNIX vendors use the same X Window, the terminal X Client is not the same, which leads to different GUI interfaces for different UNIX products.
On the left is the architecture of the Linux system, and on the right is the architecture of the Windows system. You can see that Linux has an extra layer in the middle than Windows, which results in a slower performance of Linux in the graphical interface than Windows. The exception is Apple’s MAC OS (Unix system), because the protocol used by Apple between X Server and X Client is binary, while all other Linux systems use plain text. The Linux/Unix Design Thinking has a guideline: use plain text files to store data for the following reasons.
- text is a common convertible format
- Text files are easy to read and edit
- Text data files simplify the use of Unix tools
- Increased portability overcomes speed deficiencies
- The lack of speed will be overcome by next year’s machines
KDE and GNOME
The Launch of the KDE Project
MIT’s X Window became the standard for UNIX GUI after its launch, but there are two schools of thought on commercial applications: one is the Open Look camp led by Sun, and the other is the Motif of OSF (Open Software Foundation) led by IBM/HP. After years of competition between the two sides, Motif After years of competition between the two sides, Motif finally gained the lead. However, Motif was only a GUI library (Widget-Library) with a Window-Manager, not a true GUI interface. After consultation, IBM/HP and SUN decided to integrate Motif with Open Look and develop a GUI called “CDE (Common Desktop Environment)” as the standard GUI for UNIX. Unfortunately, both Motif/CDE and UNIX systems were very expensive, and while Microsoft’s Windows was growing at a phenomenal rate and taking the lead in the desktop market, CDE remained in the UNIX domain for root system administrators, as it still is today.
By the mid-1990s, Linux, advanced in open source mode, already had a wide reach among developers. Although X Window was very mature and there were a number of X Window based GUI programs, they either did not have full graphical operations or were too expensive (e.g. CDE) to be used in Linux systems. In October 1996, a German named Matthias Ettrich, the developer of the graphic layout tool Lyx, launched the KDE (Kool Desktop Environment) project, which was different from the various X Window-based graphic programs before it. Matthias Ettrich wanted KDE to include all the application components that users needed for their daily applications, such as Web browsers, e-mail clients, office suites, graphic image processing software, etc., bringing UNIX/Linux to the desktop once and for all. Linux to the desktop once and for all. Of course, KDE is GPL compliant and runs on a free and open source basis.
When the KDE project was launched, it quickly attracted a large group of highly qualified free software developers who wanted KDE to create the best desktop operating system by linking the power of Linux systems with a comfortable and intuitive graphical interface. After a great deal of hard work, KDE 1.0 was finally launched on July 12, 1998. At that time, KDE 1.0 was technically impressive, it achieved the expected goals well, the features were available, and the developers could use it well. Of course, for users, KDE 1.0 is far less approachable than Windows 98 of the same period, and the large number of bugs in KDE 1.0 is a headache. But for developers, the launch of KDE 1.0 was encouraging, proving that the KDE project’s open source collaborative approach to development is perfectly viable and that developers are confident about the future. It is important to mention that during the development of KDE 1.0, commercial Linux companies such as SuSE and Caldera provided financial support to the project, and in 1999, IBM, Corel, RedHat, Fujitsu-Siemens and other companies also provided financial and technical support to the KDE project, and since then the KDE project has embarked on a rapid development phase and Since then, the KDE project has embarked on a rapid development phase and maintained its leadership for a long time. However, after 2004, GNOME not only began to surpass its predecessor in technology, but also gained widespread support from more commercial companies, and KDE lost its dominant position because KDE chose to develop on the basis of the Qt platform, and the copyright restrictions of Qt discouraged many commercial companies.
Qt is a cross-platform C++ GUI library from the Norwegian company TrollTech. Basically, Qt is the same type of thing as Motif, Open Look, GTK and other GUI libraries on X Window and MFC, OWL, VCL, ATL on Windows platform, but Qt has excellent cross-platform features (supports Windows, Linux, various UNIX, OS/390 and QNX, etc.), object-oriented Qt was the most powerful GUI library of its kind at the time, and Matthias Ettrich naturally chose Qt as the basis for development when he started the KDE project, and it was thanks to Qt’s perfection that development of KDE progressed quite well, for example Netscape 5.0 took only 5 days to port from Motif to Qt. Thus, when KDE 1.0 was officially released, what the outside world saw was a GUI operating environment with basic features, and Qt/KDE has maintained its leading position in the subsequent development. It is important to mention that TrollTech was substantially involved in the KDE project, as the aforementioned Netscape 5.0 port was done by TrollTech programmers, and Matthias Ettrich, the initiator of the KDE project, left academia to join TrollTech in 1998 and has been the head of the company’s software development department. Matthias Ettrich, the initiator of the KDE project, left academia to join TrollTech in 1998 and has been the head of the company’s software development department, so TrollTech has a strong influence on the KDE project.
KDE is distributed under the GPL, but the underlying Qt is a commercial software that does not follow the GPL, which puts an invisible shackle on KDE and poses possible legal risks. A large number of free programmers were deeply dissatisfied with the KDE project’s decision, and believed that using non-free software to develop was against the spirit of the GPL, so these GNU fanatics split into two groups: some of them went to work on Harmonny, trying to rewrite a Qt-compatible alternative, which was relatively simple technically but not supported by the KDE project; the other group The other side decided to redevelop a set of graphics environment called “GNOME (GNU Network Object Environment)” to replace KDE, and a GUI war started because of the differences in thinking.
GNOME and KDE alternate development
The GNOME project was launched in August 1997 by Miguel DeIcaza, a 26-year-old Mexican programmer at the time, who chose to base his project on the GTK GUI library, which is fully GPL-compliant, so we also generally refer to the GNOME and KDE camps as GNOME/GTK and KDE/Qt. Unlike Qt, which is based on the C++ language, GTK uses a more traditional C language. GTK uses the more traditional C language, although C does not support object-oriented design and seems backward, but at that time there were far more developers familiar with C than with C++. In March 1999, GNOME 1.0 was launched in a hurry, with such poor stability that many people laughed and said GNOME 1.0 was not as stable as KDE 1.0 Alpha, while KDE 1.1.2 of the same period was far superior to GNOME in both stability and functionality, and it wasn’t until the October launch of GNOME 1.0.55 that the stability issues were better resolved, giving GNOME a renewed reputation. Due to differences in thinking, GNOME developers and KDE developers were at odds on the Internet, almost to the point of mutual hatred. But either way, GNOME stumbled and took its first steps, even though KDE was the default desktop environment for almost all Linux distributions at the time.
GNOME’s turnaround came with the support of commercial companies. RedHat, the Linux industry leader at the time, disliked the KDE/Qt copyright and immediately supported the GNOME project after it was launched. To promote GNOME’s maturity, RedHat even dedicated several full-time programmers to GNOME development, and in January 1998 joined forces with GNOME project members to form the RedHat Advanced Development Lab. This company, later renamed Ximian, became the de facto parent company of the GNOME project, and is responsible for the Evolution mail suite on the GNOME platform. A series of major events followed in 2000, starting with the formation of Eazel by a group of engineers from Apple to design the user interface and Nautilus file manager for GNOME. In August of the same year, the GNOME Foundation was officially established through the joint efforts of Sun, RedHat, Eazel, and Helix Code (Ximian), which is responsible for managing and funding the development of the GNOME project, with Miguel himself serving as the Foundation’s president. At this time, GNOME gained the support of many heavyweight commercial companies, such as Hewlett-Packard, which adopted GNOME as a user environment for HP-UX systems, SUN, which announced the integration of the Star Office suite with the GNOME environment, and GNOME, which will choose OpenOffice.org as its office suite, and IBM, which shared the SashXB Extreme Development Environment for GNOME. Meanwhile, the GNOME Foundation has decided to adopt Mozilla as its web browser.
Not to be outdone, the KDE camp launched the much-anticipated KDE 2.0 in October of that year. KDE 2.0 was the largest free software at the time, including Koffice Office Suite, Kdevelop IDE and Konqueror web browser, in addition to the KDE platform itself. Although all these software were still relatively crude, KDE 2.0 was well on its way to achieving Matthias Ettrich’s goal of setting up the KDE project. Also this month, TrollTech decided to adopt the GPL convention to distribute a free version of Qt, hoping to win the support of developers. In this way, Qt is effectively dual-licensed: if the corresponding Linux distribution is distributed on a free, non-commercial basis, then KDE can be used without paying a license fee to TrollTech; but if the Linux distribution is for-profit, commercial software, then KDE must be licensed. Since TrollTech is a commercial company and has been leading the direction of KDE, the dual licensing approach is a good solution to the conflict between open source and profitability, and TrollTech claims that the dual licensing system has completely solved the problems of KDE in terms of the GPL convention, but RedHat does not like it, and RedHat continues to provide support to the GNOME project in the hope that it will soon become Maturity, and Linux vendors other than RedHat are on the side of KDE for now, but they also bundle the GNOME desktop with their distributions.
In 2001-2002, the hot Linux movement began to fall into a downturn, with almost all vendors finding desktop Linux versions unprofitable and the lack of ease of use discouraging the industry from seeing a future for Linux on the desktop. However, in the server market, Linux was growing very rapidly, posing a direct threat to UNIX and Windows Server. In April 2001, GNOME 1.4 was released, fixing the bugs and improving the functionality of the previous version, but still falling short of KDE in all aspects; in August of the same year, KDE was developed to version 2.2. In April 2002, KDE jumped to version 3.0, which was based on Qt 3.0, and was quite complete and had excellent value; two months later, the GNOME camp also launched version 2.0, which was based on the more complete GTK 2.0 graphics library. In 2003, KDE and GNOME entered into a real technical battle, and in January, KDE 3.1 was launched, while GNOME 2.4 followed in February, with both platforms striving for self-improvement. This year also saw a series of major acquisitions in the Linux business world: in January, Novell announced the acquisition of Germany’s SuSE Linux, the second largest Linux business in the world after RedHat, and in August, Novell went on to acquire GNOME’s parent company, Ximian. These two acquisitions made Novell a powerful Linux company on par with RedHat, and Novell and RedHat became the two companies that could influence the future of Linux. SuSE has always chosen KDE for its graphical environment and has invested considerable effort in KDE. after the acquisition by Novell, SuSE’s desktop distribution, although still focused on KDE, also disliked the Qt license Novell has begun to migrate to GNOME. kde 2.0 has a wealth of applications and is significantly stronger than GNOME.
Entering 2004, KDE and GNOME still maintain rapid development, KDE camp in February and August respectively launched 3.2, 3.3 version, GNOME in March and September launched 2.6 and 2.8, the two version upgrade pace equal. By version 3.3 KDE was already very mature, with a large number of applications including KOffice, Konqueror browser, Kmail suite, KDE instant messaging, and most of them up to usable standard, no less functional than Windows 2000. GNOME 2.8 is not inferior to KDE 3.3, and at this time the technical characteristics of the two are very distinct: GNOME is about simplicity, efficiency, running faster than KDE; KDE has a gorgeous interface and rich features, and the use of habits are also more similar to Microsoft Windows. In terms of commercial support, RedHat is still a hardcore supporter of GNOME, IBM, SUN, Novell, HP and other heavyweights have also chosen GNOME, while KDE’s main supporters are temporarily SuSE, Mandrake, as well as the domestic publishers, including CK Red Flag and Gongchuang Open Source. 2005, GNOME began to make a full comeback, March 2.10 in March and 2.12 in September let GNOME get nearly transformed changes, plus OpenOffice.org 2.0, Firefox 1.5 and other heavy software introduced to GNOME as a tiger; KDE was launched in March and November 3.4 and 3.5, where KDE 3.5 is also close to the perfect situation, we think it level is comparable to GNOME 2.12. But KDE has been deteriorating in terms of commercial support, with Novell announcing in November that all of its commercial distributions will use GNOME as the default desktop (and will still provide support for KDE Libraries), SuSE Linux desktop will provide equal support for KDE and GNOME, and the community-supported OpenSuSE will still use the KDE system. -but everyone understands that GNOME will be the center of gravity for Novell, and KDE will be active in free distributions. Note: Qt 4.5, released on March 3, 2009, follows the LGPL 2.1 agreement and relaxes the licensing of KDE libraries, making the development of commercial private copyright programs under the platform freer than before.
Here we find a rather dramatic ending: KDE, which is committed to commercialization, has instead lost the support of heavyweight commercial enterprises, and although some small and medium-sized Linux companies will continue to support KDE because of its technical capabilities, its commercial future is limited. Instead, GNOME, which follows the GPL and does not aim to be commercialized at all, has become a huge success in the field. Many Linux enthusiasts don’t understand why the excellent KDE is being treated so badly, but the reason is very simple - no heavyweight company likes to be controlled, and maybe KDE’s Qt doesn’t require a lot of licensing fees, but who knows if TrollTech will ask for more in the future? If there’s a free option for GNOME, why not? For this reason, RedHat, Novell, two of the largest Linux companies and SUN have adopted GNOME, and their strong support for GNOME allows the project to have enough technical assurance to lay a solid foundation for future rapid development. To correct a possible misconception, although Novell acquired Ximian, RedHat has not been affected too much, and both sides share their contributions to GNOME, which is distributed under the GPL free copyright convention, so cooperation is a win-win situation. As for the KDE project, although it loses the support of these commercial giants, small and medium-sized Linux vendors without the ability to switch desktops will continue to follow KDE, and it still has a strong life in non-commercial community Linux distributions.
Despite the competition on the commercial side, the developer relationship between the two camps, GNOME and KDE, is not getting worse, rather they both realize the importance of supporting each other. If KDE and GNOME are unable to share applications, it would not only be a huge waste of resources, but would lead to a fundamental split in Linux. In fact, both GNOME developers and KDE developers share the common goal of developing the best graphical environment for Linux, but are in different camps because of the difference in philosophy. KDE and GNOME started to support each other’s programs around 2003 - as long as you install the GTK library in the KDE environment, you can run GNOME programs, and vice versa. After more than two years of work, both KDE and GNOME have achieved a high level of interoperability, and programs for both platforms are fully shared, for example, you can run Konqueror browser and Koffice suite in GNOME, and Evolution and OpenOffice.org in KDE, but the speed and visual effect of executing native programs is better. and visual effects will be better. In the next year or two, there will be a higher level of integration between KDE and GNOME, but the two will probably never be one - GNOME will still be GNOME and KDE will still be KDE. MacOS X has a very different culture. Not to mention the fact that there are more and more free software developers around the world and Linux users’ preferences are not always the same, there is nothing wrong with keeping two graphical environment projects that are developed in parallel. As for the developers of the GNOME project and the KDE project, they were once at loggerheads because of their different philosophies, but they are now releasing their differences because everyone realizes that they actually need each other, and uniting together will give them a greater voice in front of the hardware manufacturers, thus prompting them to provide a corresponding version of Linux while launching Windows drivers, and to can learn from each other’s good design to ensure that Linux has a best graphic desktop environment.
QT vs. GTK+
From the information above, we learned that there are major differences between QT and GTK at the licensing protocol level. So what are the differences beyond that?
- GTK+ : GTK+ is developed in C, which is more complex and difficult to write object-oriented in C, and is full of a lot of macros, which are not easy to use and debug. Although the idea is more advanced, but the use of the trouble.
- QT : Qt is a cross-platform C++ graphics application framework. Compared to GTK+, Qt’s biggest advantage object-oriented, Qt’s good packaging mechanism makes Qt’s modularity is very high, reusability is better, for user development is very convenient.
GTK+ and QT are the equivalent of MFC on Windows, but there is also the concept of Xlib, which is actually a wrapper for the underlying X protocol and can be used for general graphics output. Since the interface of Xlib is too primitive and complex, general graphics programs choose other advanced graphics libraries as their base. The direct relationship between Xlib, QT and GTK is as follows.
QT uses the xlib library directly. GTK cannot use xlib directly, but uses the lower-level function libraries GDK and Glib. where.
- GLib == G Libray: some basic common tools and common functions implemented to improve portability
- GDK == GTK+ Drawing Kit: Masking and packaging of the underlying windowing system
This structure allows Gtk to be ported more easily to other systems or to use graphics libraries that are not related to the X Windows system.
KDE Plasma 5 is a set of graphical interface shell layers written by KDE and is the successor to KDE Plasma 4, initially released in a stable version on July 15, 2014. A converged graphics interface shell layer that can be switched between shell layers on different target devices. Some unseen changes include the migration to a new display stack with full hardware acceleration support, built on OpenGL/OpenGL ES.
Because KDE Plasma 5 uses and is built on top of Qt 5 and KDE Frameworks 5, it is possible to adapt the backend to display using a variety of windowing systems, including X11 and Wayland display protocols, all the way to Quartz and GDI+.
GNOME 2 to GNOME 3
GNOME 2 is very similar to the traditional desktop interface, with a desktop environment where users can interact with different virtual objects such as windows, icons, files, etc. GNOME 2 uses Metacity as its default window manager, and GNOME 2’s window, program and file management is very similar to that of a typical desktop operating system. By default, the desktop has a launch menu to open installed programs and files; existing windows are listed in the taskbar below; and a notification area in the upper-right corner to show programs running in the background. However, these features can be repositioned, replaced or even removed according to user preferences.
Prior to GNOME 3, GNOME was designed based on traditional desktop comparisons, but in GNOME 3 it was replaced by GNOME Shell, with all window transitions and virtual desktops taking place in the “active” screen. In addition, because Mutter has replaced Metacity as the default window manager, the minimise and zoom buttons are no longer in the name bar by default, and Adwaita has replaced Clearlooks as the default theme. Many of the core GNOME applications have been redesigned to provide a more coherent user experience.
These major changes initially drew widespread criticism. The MATE desktop environment project was derived from the GNOME 2 source code, with the goal of preserving the traditional GNOME 2 interface while supporting the latest Linux technologies such as GTK+ 3. The Linux Mint team addressed this with the development of “Mint GNOME Shell Extensions”, a series of plugins that run on GNOME 3. a series of plugins that run on GNOME 3 to solve this problem, these plugins make GNOME 3’s interface back to the traditional comparison interface. Finally, Linux Mint decided to derive another desktop environment, “Cinnamon”, from the GNOME 3 source code.
As of 2015, the overall opinion of GNOME 3 has turned generally positive, and the Linux distribution Debian changed XFCE to the default desktop environment when GNOME 3 was released, but switched back to GNOME 3 by default in Debian 8. Linux founder Linus Torvalds switched back to GNOME 3 in 2013.
Unity is Ubuntu’s own desktop environment solution, a graphical user interface developed by Canonical, the company behind Ubuntu. No other Linux distribution currently uses Unity as its desktop solution, which runs on top of the Gnomes desktop environment and uses all of Gnome’s core applications to build the environment.
Originally designed by Canonical for netbooks, Unity was first introduced in the Ubuntu 10.10 netbook release, initially to take advantage of the limited screen size of netbooks, but the Gnome development team did not take the advice of the Ubuntu team and followed their own approach. That’s when Canonical developed its own shell (Unity) to get out of this bind and to better meet its own needs. Unlike GNOME and KDE SC, Unity is not a desktop package, and it takes up more system resources than GNOME 3 or KDE. In the Unity desktop environment, there is only one top panel and a class of Dock application launcher on the left side of the desktop.
In April 2017, Mark Shuttleworth announced that he would switch back to GNOME in 2018. Ubuntu 17.04 was the last version of the Unity desktop environment to be pre-installed. Marius Gripsgård has announced that he will take over the development of Unity 8, now developed and published by UBports (now renamed Lomiri).
MATE, a desktop environment, is derived from the GNOME 2 source code, which is no longer officially maintained. The radical interface changes of GNOME 3 led to much criticism, and many people decided to create a GNOME-derived desktop environment that maintains the traditional GNOME 2 style. The name change was made to avoid conflicts with GNOME 3’s constituent components.
MATE and Cinnamon are two very similar desktop environments - in fact, Linux Mint supports both Cinnamon or MATE desktop environments. While Cinnamon takes some of the code from GNOME 3 and forks it into a more traditional desktop set, MATE does something more radical - taking the much older GNOME 2 desktop code and updating it in modern Linux distributions. example of how open source can enable developers to fight the end of a project’s life. Theoretically, GNOME 2 would be replaced by GNOME 3, but it still exists because a developer built a branch of that code and continued to develop it.
Cinnamon is another desktop environment created by the Linux Mint Team after MATE for disgruntled Gnome users. Unlike Mate, which was based on GNOME 2, the Linux Mint Team responded to industry criticism by developing the “Mint GNOME Shell Extensions”, a series of plugins based on GNOME 3 that turned the GNOME 3 interface back into a traditional one. Finally, Linux Mint decided to derive another desktop environment from the GNOME 3 source code, named Cinnamon.
Originally written in modern code as part of the GNOME 3 fork, Cinnamon has been retooled to provide users with a more traditional desktop interface. While GNOME ditched the taskbar and start menu-like interface to display installed applications, Cinnamon chose to build its desktop environment around these more traditional features. In addition, Cinnamon has always added more features and improvements for desktop users than GNOME, which strives to simplify the desktop by cutting features and options, or Unity, which emphasizes the smartphone platform.
Many Linux distributions offer their own Cinnamon style support, such as Ubuntu, Fedora, OpenSUSE, Gentoo, Arch Linux, and Cinnamon is the default desktop environment for Linux Mint. For the best Cinnamon experience, please use it together with Linux Mint.
Xfce is a fast, lightweight desktop environment on Unix-like operating systems. It is designed for productivity and is very configurable, while still conforming to the Freedesktop specification. Unlike heavyweight desktop environments such as Gnome and KDE Plasma, Xfce takes up far fewer system resources. XFCE is very small, lightweight, efficient, and runs programs quickly, making it ideal for older machines or those with little memory. Distributions that use XFCE as their default desktop include Xubuntu and Manjaro.
XFCE incorporates the UNIX development philosophy of “modularity” and “reusability”, and includes many components that can be installed separately or applied to other desktop environments. Users can also choose from GNOME and other related software to customize their desktop environment to suit their needs.
Overall, Xfce is in a bit of an awkward position. Traditionally speaking, it would have been the third most popular option after GNOME and KDE. After the official release of GNOME 3, Xfce has become the top “traditional” Linux desktop environment.
Since then, Xfce has been under attack from two new rivals, Lxde, which is much lighter, and Cinnamon, which boasts a richer feature set. In that sense, MATE is more feature-rich and about equal to Xfce in terms of lightness. Xfce is still around, but it is not growing as fast as it used to.
LXDE, or Lightweight X11 Desktop Environment, is designed to provide a new lightweight, fast desktop environment that runs on Unix and POSIX-compatible platforms such as Linux and BSD. LXDE is now the king of lightweight and user-friendly desktop environments. If you have an antique computer on hand but want to put it to some use, then Lxde is the right choice.
Unlike other desktop environments for Linux, LXDE has very few component dependencies, and most components can function independently without relying on other components. LXDE places more emphasis on usability and lightness than on power and the accompanying size and resource consumption, and tries to reduce the system resources it consumes. While XFCE is light enough, LXDE is even better.
LXDE uses GTK + 2, which is a very old code. GTK + 3 has been around since 2011, and LXDE maintainer Hong Jen Yee questioned some of the changes to GTK + 3, so he released a Qt-based port in 2013. Soon after, the Qt version of LXDE and a separate desktop interface called Razor-qt were merged to form LXQt. Hong Jen Yee plans to eventually focus his efforts on LXQt. Since then, LXQt has officially become a separate project.
i3 is a tiled window manager for X11, inspired by wmii and written in C. i3 supports tiled, cascaded, and tabbed windows, and automatically arranges them to make the most of screen space. i3 is configured using plain text files and can be extended in multiple programming languages through Unix domain sockets and a JSON-based IPC interface.
Like wmii, i3 uses a control system similar to vi. By default, changing the window focus requires pressing both the Mod1 key (Alt or Win) and the arrow keys (JKL; or ↑↓←→), while moving the window requires adding the Shift key to this.
Although i3 is a tiled window manager, special windows such as password entry boxes are not displayed as a tiled window, but appear on top of all tiled windows, just like in desktop environments such as GNOME or KDE.
Budgie, developed by the Solus project and several communities (such as Arch Linux, Manjaro Linux and Ubuntu Budgie), is the default desktop environment for Solus OS. A desktop environment using GNOME (e.g. GTK+ 3.0+). In addition to adopting a more modern design, Budgie can emulate the look and feel of the GNOME 2 desktop. budgie’s design focuses on simplicity and beauty.
Its default desktop is very minimalist, with just panels and a blank desktop. budgie includes an integrated sidebar (called Raven) that provides quick access to the calendar, audio controls and settings menu. raven also includes an integrated notification area that contains a unified system message display similar to macOS.
Pantheon is the default desktop environment for the elementary OS operating system. It was written from scratch using Vala and the GTK3 toolkit. As far as ease of use and appearance, the desktop has some similarities to GNOME Shell and Mac OS X.
Liri is a desktop environment with modern design and functionality. Liri is a merger between Hawaii, Papyros and Liri Project. The design style is Google’s Material Design.
UKUI, or UbuntuKylin UI, is a desktop environment based on Mate. The main feature of this desktop environment is that its layout, style and usage habits are close to those of traditional Windows. its latest version is UKUI 3.0. in 2016, UKUI was released with Ubuntu Kylin 16.04 UKUI Preview, and as of 2018, UKUI is the default desktop environment for both Galaxy Kylin Community Edition and YouKylin, and has entered the Ubuntu, Debian and other Linux distributions’ official repositories.
Deepin Desktop Environment (DDE) is the desktop environment for the Linux distribution Deepin.
Deepin systems used to use the GNOME desktop environment. As the GNOME desktop environment gradually limited customization, the Deepin team started to develop its own desktop environment, Deepin DE (DDE). The desktop environment was earlier written in HTML5 etc., but the performance was not good, and later rewritten in Qt with Go on the back end. deep DE mainly consists of desktop, launcher, taskbar, control center etc. Deep also maintains its own window manager, DDE kwin.
Some Linux distributions such as Arch Linux also include the Deepin desktop environment in their packages. manjaro Linux used to have a community supported version called Manjaro Deepin, which came with the Deepin desktop environment and accompanying applications pre-installed. DDE can also be found in the Fedora 30 repositories.
In addition to the Deep Desktop Environment (DDE), the deepin system includes several software programs developed specifically for deepin, such as Deep Control Center, Deep Store, etc., which are open source under the GPL version 3 agreement. deepin also comes with a series of applications created by the deepin development team, including Deep Cinema, Deep Terminal, Deep Boot Disk Maker, Deep Record Screen, Deep Recording, Deep Screenshot, Deep Image Viewer, Deep Editor, etc. Deepin also comes with a series of applications created by the deepin development team, including Deep Cinema, Deep Terminal, Deep Boot Disk Maker, Deep Screen Recorder, Deep Recording, Deep Screenshot, Deep Image Viewer, Deep Editor, etc.
deepin inherits all software packages from Debian stable and provides its own repository of popular software such as Vivaldi . In addition, Deepin system is pre-installed with WPS Office, Sogou Input Method, Youdao Dictionary, NetEase Cloud Music and some other applications developed specifically for Deepin, which are commonly used by users in mainland China. Deepin is a strategic partner of CodeWeavers. a version of CodeWeavers’ CrossOver is bundled with Deepin, now Deepin’s CrossOver license has expired, but Deepin has developed Deepin-wine based on wine, so Deepin can still It can still run some software on Windows, such as Tencent QQ.