๐Ÿš€ Mastering Terminals: A Comprehensive Guide to GUI and CLI in Red Hat Enterprise Linux ๐Ÿš€

Prateek Srivastava
3 min readNov 19, 2023

--

In the intricate world of Red Hat Enterprise Linux (RHEL), understanding the dynamics of Graphical User Interface (GUI) and Command-Line Interface (CLI) terminals is paramount. In this blog post, weโ€™ll unravel the secrets of seamlessly switching between GUI and CLI terminals, explore the capabilities of the tty and chvt commands, and delve into the art of expanding the number of terminals in the Virtual Terminal (VT) system.

GUI vs. CLI Terminals: Bridging the Gap

Graphical User Interface (GUI):

  • Experience a user-friendly, visually intuitive interface.
  • Navigate through applications with mouse clicks and windows.
  • Ideal for tasks requiring graphical representation and interactivity.

Command-Line Interface (CLI):

  • Unleash the power of text-based commands for precise control.
  • Execute tasks efficiently without the need for a graphical environment.
  • Essential for system administrators and power users.

Switching Between Terminals: The tty and chvt Commands

1. tty Command:

  • Discover the terminal device associated with your session.
  • Execute tty in the CLI to reveal the terminal file, e.g., /dev/pts/0.

2. chvt Command:

  • Seamlessly switch between virtual terminals.
  • Use chvt [N] to jump to the desired terminal (e.g., chvt 2 for VT2).
chvt 2

Increasing the Number of Terminals in VT

1. Understanding Virtual Terminals:

Virtual Terminals (VTs) are separate text-based consoles that allow users to interact with the system independently. On RHEL, you can access VTs using keyboard shortcuts:

  • Ctrl+Alt+F1 to F6: Switch between VTs. Each function key (F1 to F6) represents a different terminal.
  • By default, we have F2 for GUI and F3 to F6 for CLI

2. Configuration File Tweaks:

  • To adjust the number of Virtual Terminals, we need to modify the /etc/systemd/logind.conf file:
  • Open the Configuration File:
sudo nano /etc/systemd/logind.conf
  • Locate and Modify NAutoVTs: Find the NAutoVTs parameter in the file. This parameter defines the number of automatic VTs that will be spawned. Uncomment the line and set the desired number.
  • Example:
#NAutoVTs=6 NAutoVTs=8
  • Save and Exit: Save the changes and exit the text editor.
  • Restart the Systemd-Logind Service:
sudo systemctl restart systemd-logind

3. Creating Multi-GUI Terminals:

  • Spanning graphical terminals across multiple displays enhances workspace flexibility. This can be achieved using tools like xrandr:
  • Install xrandr (if not installed):
sudo dnf install xrandr   # For RHEL 8 and Fedora
  • Display Connected Screens: Run the following command to view connected screens:
xrandr
  • Configure Multi-GUI Terminals: Use xrandr to configure multiple displays. For example, to extend the display to a second screen:
xrandr --output VGA-1 --auto --right-of LVDS-1
  • Here, VGA-1 and LVDS-1 are placeholders for actual display names.
  • Save Configuration: To make the changes persistent, create a script to execute xrandr commands during system startup.
  • Example:
#!/bin/bash xrandr --output VGA-1 --auto --right-of LVDS-1
  • Save the script, grant execute permissions, and add it to the startup applications.

Conclusion: A Terminal Symphony in RHEL

Navigating the diverse landscape of GUI and CLI terminals in Red Hat Enterprise Linux unlocks a world of possibilities. Whether youโ€™re a GUI enthusiast or a CLI maestro, mastering these terminal intricacies elevates your Linux experience.

๐Ÿ™ Thank You for Reading!

Your time and attention mean a lot to us. We greatly appreciate your engagement with our content and would love to hear your thoughts and ideas. Letโ€™s stay connected and continue our journey through the digital world together! ๐ŸŒ๐Ÿ“š๐Ÿ’ก

Letโ€™s Stay in Touch ๐Ÿช‚ Connect with us on: LinkedIn, Instagram

--

--

Prateek Srivastava
Prateek Srivastava

Written by Prateek Srivastava

Motivated and innovative professional with 6 years of versatile experience spanning Site Reliability Engineering (SRE) and Research & Development (R&D).

No responses yet