Check the desktop environment in Linux

Source: Internet
Author: User
Tags egrep

Check the desktop environment in Linux
Linux desktop systems include gnome, kde, mate, cinnamon, lxde, xfce, and jwm. Common examples are gnome, kde, and xfce. So how can we determine which desktop environment components are installed in Linux? The following summarizes some methods to check the desktop environment: Method 1: env | grep reply top_session = or echo $ reply top_session this command can only be entered after the desktop system, you can run the command in the startup command window of the desktop system to obtain the result. If you connect to the system using the SecureCRT tool, no results will be obtained when you run this command. Method 2: echo $ GDMSESSION this command can only be executed in the startup command window of the desktop system after entering the desktop system. You can use the SecureCRT tool to connect to the system. If you execute this command, no results will be obtained. I tested two desktop environments (KDE and GNOME), but I don't know whether it is OK in other desktop environments. The two commands cannot be displayed in some desktop environments. Method 3: run the ps command to check whether the desktop environment is installed. 3.1: No desktop components are installed. [root @ testlnx01 ~] # Runlevel N 3 [root @ testlnx01 ~] # Ps-A | egrep-I "gnome | kde | mate | cinnamon | lx | xfce | jwm" 3.2: gnome Desktop components are installed.

[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm" 2304 ?  00:00:00 gnome-keyring-d 2314 ?  00:00:00 gnome-session 2352 ?  00:00:00 gnome-settings- 2377 ?  00:00:00 gnome-panel 2408 ?  00:00:00 gnome-power-man 2420 ?  00:00:00 polkit-gnome-au 2430 ?  00:00:00 gnome-volume-co 2448 ?  00:00:00 gnome-screensav 2497 ?  00:00:01 gnome-terminal 2500 ?  00:00:00 gnome-pty-helpe

 

Pgrep-l "gnome | kde | mate | cinnamon | lxde | xfce | jwm" ps-A | egrep-I "gnome | kde | mate | cinnamon | lxde | xfce | jwm" use the ps command or pgrep command
[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm" 2304 ?  00:00:00 gnome-keyring-d 2314 ?  00:00:00 gnome-session 2352 ?  00:00:00 gnome-settings- 2377 ?  00:00:00 gnome-panel 2408 ?  00:00:00 gnome-power-man 2420 ?  00:00:00 polkit-gnome-au 2430 ?  00:00:00 gnome-volume-co 2448 ?  00:00:00 gnome-screensav 2497 ?  00:00:01 gnome-terminal 2500 ?  00:00:00 gnome-pty-helpe[root@localhost ~]# pgrep -l  "gnome|kde|mate|cinnamon|lx|xfce|jwm"2304 gnome-keyring-d2314 gnome-session2352 gnome-settings-2377 gnome-panel2408 gnome-power-man2420 polkit-gnome-au2430 gnome-volume-co2448 gnome-screensav

 

If I unregister a user from the desktop environment and exit, as shown below, you will see that the process displayed by the same command is obviously less
[root@localhost ~]# pgrep -l  "gnome|kde|mate|cinnamon|lx|xfce|jwm"2882 gnome-session2890 gnome-settings-2909 polkit-gnome-au2911 gnome-power-man[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm" 2882 ?  00:00:00 gnome-session 2890 ?  00:00:00 gnome-settings- 2909 ?  00:00:00 polkit-gnome-au 2911 ?  00:00:00 gnome-power-man[root@localhost ~]# 

 

Method 4: yum grouplist | more check

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.