Curious about your Linux desktop's screen resolution? Want to know how to find it using simple commands? Look no further! In this guide, we’ll walk you through the steps to find your Linux desktop screen resolution, both from the command line and using a graphical interface.
To check your monitor's resolution, refresh rate and other information on a Linux system, you can use several tools and commands.
First, we will learn how to display the screen resolution in Linux from command line.
Table of Contents
Find Desktop Screen Resolution in Linux from Command line
Here, we will use the following tools to find the screen resolution of your Linux desktop from command line:
- xrandr,
- xdpyinfo,
- inxi,
- edid-decode,
- dmesg.
1. Check Linux Desktop Screen Resolution using xrandr Command
The xrandr (stands for "X Resize and Rotate") is a command-line tool used in the X Window System, which is the underlying graphical system used by most Unix-like operating systems, including Linux.
The xrandr utility enables users to configure and manipulate various display settings, such as screen resolution, refresh rate, rotation, and more, directly from the command line.
With "xrandr," you can perform tasks like changing the resolution of your monitor, adjusting the orientation of your screen (landscape, portrait, etc.), setting up multi-monitor configurations, and diagnosing display issues.
This command is especially handy for those who prefer working with the command line or need to automate display-related tasks.
xrandr comes pre-installed in most Linux distributions.
To find your screen resolution in Linux using xrandr, simply run:
xrandr
This will output a list of all of the available display settings.
Screen 0: minimum 320 x 200, <strong><mark>current 1920 x 1080</mark></strong>, maximum 16384 x 16384 DP-1 disconnected (normal left inverted right x axis y axis) DP-2 disconnected (normal left inverted right x axis y axis) HDMI-1 disconnected (normal left inverted right x axis y axis) DP-3 connected primary <strong><mark>1920x1080</mark></strong>+0+0 (normal left inverted right x axis y axis) 476mm x 268mm <strong><mark>1920x1080</mark></strong> 60.00*+ 50.00 59.94 1600x900 60.00 1280x1024 75.02 60.02 1152x864 75.00 1280x720 60.00 50.00 59.94 1024x768 75.03 60.00 800x600 75.00 60.32 720x576 50.00 720x480 60.00 59.94 640x480 75.00 60.00 59.94 720x400 70.08 DP-4 disconnected (normal left inverted right x axis y axis)
As you see in the output above, my current Debian desktop resolution is 1920x1080 pixels.
You can also use xrandr command with the grep command to extract only the resolution and exclude other details.
xrandr | grep '*' | awk '{ print $1 }'1920x1080
Let's break down what each part of the above command does:
- xrandr: This command is used to query and configure display settings in the X Window System. When you run this command without any options, it displays information about the connected monitors and their available resolutions.
- | (Pipe): The pipe symbol (|) is used to take the output from the command on the left side and use it as input for the command on the right side.
- grep '*': This part of the code uses the "grep" command to search for lines containing an asterisk (*). In the context of "xrandr" output, an asterisk often indicates the currently active screen resolution.
- awk '{ print $1 }': This part of the code uses the "awk" command to print the first column of text from the lines that were filtered by the previous "grep" command. In the context of "xrandr" output, the first column usually represents the screen resolution.
Putting it all together, this command will filter the output of the "xrandr" command to extract the currently active screen resolution, which is often marked with an asterisk in the "xrandr" output. It uses the "grep" command to find lines with an asterisk and then uses "awk" to print the first column (which contains the resolution).
Related Read: How To Adjust Monitor Brightness From Command Line In Linux
2. Find Linux Desktop Screen Resolution using xdpyinfo Command
The xdpyinfo is a command-line utility in the X Window System that provides information about the display and the X server's capabilities. It stands for "X Display Information" and is used to retrieve various details about the X server and the connected displays.
When you run the xdpyinfo command, it provides a comprehensive set of information about the X server and the display it's running on. This information can include details about the screen size, color depth, available extensions, fonts, and more.
Xdpyinfo is useful for diagnosing display-related issues, checking the capabilities of the X server, and gathering information about the connected monitors.
For example, you can use xdpyinfo to find out the screen resolution, the number of available screens, the current color depth, and other relevant details about the display setup.
In summary, "xdpyinfo" is an useful tool for obtaining detailed technical information about the X server and the connected displays in a Unix-like operating system, including Linux.
To display the desktop screen resolution of your Linux system using the xdpyinfo utility, you'd use:
xdpyinfo | grep dimensions
This command will output information that includes the dimensions of your screen in pixels.
dimensions: 1920x1080 pixels (508x285 millimeters)
You can also use the grep and awk commands with "xdpyinfo" to extract the resolution only:
$ xdpyinfo | grep dimensions | awk '{print $2}' 1920x1080
Let's break down what each part of the command does:
- xdpyinfo: This command is used to retrieve detailed information about the X server and the connected display(s). When you run this command, it outputs a comprehensive set of information about the display configuration and capabilities of the X server.
- | (Pipe): The pipe symbol (|) is used to take the output from the command on the left side and use it as input for the command on the right side.
- grep dimensions: This part of the code uses the "grep" command to search for lines containing the word "dimensions." In the context of "xdpyinfo" output, lines containing "dimensions" typically provide information about the screen dimensions (resolution).
- awk '{print $2}': This part of the code uses the "awk" command to print the second column of text from the lines that were filtered by the previous "grep" command. In the context of "xdpyinfo" output, the second column usually contains the screen dimensions.
Putting it all together, the above command will filter the output of the "xdpyinfo" command to extract the screen dimensions (resolution) of the current display. It uses "grep" to find lines with the word "dimensions" and then uses "awk" to print the second column (which contains the resolution). The result is the display of the screen resolution of the current display.
The xdpyinfo tool also comes pre-installed in most Linux distributions. If the xdpyinfo command is not found for any reason, you can install it using the package manager for your particular Linux distribution.
For example, on Ubuntu or Debian, you would use:
$ sudo apt-get install x11-utils
And on Fedora, RHEL, AlmaLinux, Rocky Linux, you would use:
$ sudo dnf install xorg-x11-utils
On older RPM-based systems, use yum instead of dnf as shown below.
$ sudo yum install xorg-x11-utils
Keep in mind that these commands need to be run in a terminal on the Linux desktop itself. They won't return the correct results if run over a remote SSH session, unless you've set up X11 forwarding.
3. Display Monitor Resolution using Inxi
inxi is a powerful system information tool that can display monitor details.
Install inxi if it is not installed already:
sudo apt install inxi
Run the following command to display monitor information:
inxi -G
Look for the "Display" section, which will show the resolution and refresh rate.
Sample Output:
Graphics: Device-1: Intel Tiger Lake-LP GT2 [UHD Graphics G4] driver: i915 v: kernel Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 resolution: 1920x1080~60Hz API: OpenGL v: 4.6 Mesa 22.3.6 renderer: Mesa Intel UHD Graphics (TGL GT2)
4. Check Monitor Resolution and Refresh Rate using edid-decode in Linux
If you want detailed information about your monitor’s capabilities, including supported resolutions and refresh rates, you can use edid-decode to read the EDID (Extended Display Identification Data).
Install edid-decode if it’s not already installed:
sudo apt install edid-decode
Run the following command to extract the EDID information:
sudo cat /sys/class/drm/card1-DP-2/edid | edid-decode
Replace card1-DP-2 with the appropriate connector for your setup (e.g., card0-DP-1 for DisplayPort). You can find the correct connector by checking the /sys/class/drm/ directory.
Look for the "Detailed Timing Descriptors" section in the output. It will list all supported resolutions and refresh rates.
edid-decode (hex):00 ff ff ff ff ff ff 00 10 ac 09 20 01 01 01 0124 1f 01 03 80 30 1b 78 2a 69 25 a3 5b 50 a3 2711 50 54 a5 4b 00 71 4f 81 80 a9 c0 d1 c0 01 0101 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c45 00 dc 0c 11 00 00 1e 00 00 00 ff 00 30 50 3734 46 31 38 54 31 33 48 42 0a 00 00 00 fc 00 4532 32 31 39 48 4e 0a 20 20 20 20 20 00 00 00 fd00 38 4c 1e 53 11 00 0a 20 20 20 20 20 20 01 8f02 03 1a b1 4f 90 05 04 03 02 07 06 1f 14 13 1211 16 15 01 65 03 0c 00 10 00 02 3a 80 18 71 382d 40 58 2c 45 00 dc 0c 11 00 00 1e 01 1d 80 1871 1c 16 20 58 2c 25 00 dc 0c 11 00 00 9e 01 1d00 72 51 d0 1e 20 6e 28 55 00 dc 0c 11 00 00 1e02 3a 80 d0 72 38 2d 40 10 2c 45 80 dc 0c 11 0000 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ee----------------Block 0, Base EDID: EDID Structure Version & Revision: 1.3 Vendor & Product Identification: Manufacturer: DEL Model: 8201 Serial Number: 16843009 Made in: week 36 of 2021 Basic Display Parameters & Features: Digital display Maximum image size: 48 cm x 27 cm Gamma: 2.20 DPMS levels: Off RGB color display First detailed timing is the preferred timing Color Characteristics: Red : 0.6376, 0.3574 Green: 0.3144, 0.6376 Blue : 0.1523, 0.0683 White: 0.3134, 0.3291 Established Timings I & II: IBM : 720x400 70.081663 Hz 9:5 31.467 kHz 28.320000 MHz DMT 0x04: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz DMT 0x06: 640x480 75.000000 Hz 4:3 37.500 kHz 31.500000 MHz DMT 0x09: 800x600 60.316541 Hz 4:3 37.879 kHz 40.000000 MHz DMT 0x0b: 800x600 75.000000 Hz 4:3 46.875 kHz 49.500000 MHz DMT 0x10: 1024x768 60.003840 Hz 4:3 48.363 kHz 65.000000 MHz DMT 0x12: 1024x768 75.028582 Hz 4:3 60.023 kHz 78.750000 MHz DMT 0x24: 1280x1024 75.024675 Hz 5:4 79.976 kHz 135.000000 MHz Standard Timings: DMT 0x15: 1152x864 75.000000 Hz 4:3 67.500 kHz 108.000000 MHz DMT 0x23: 1280x1024 60.019740 Hz 5:4 63.981 kHz 108.000000 MHz DMT 0x53: 1600x900 60.000000 Hz 16:9 60.000 kHz 108.000000 MHz (RB) DMT 0x52: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz Detailed Timing Descriptors: DTD 1: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz (476 mm x 268 mm) Hfront 88 Hsync 44 Hback 148 Hpol P Vfront 4 Vsync 5 Vback 36 Vpol P Display Product Serial Number: '0P74F18T13HB' Display Product Name: 'E2219HN' Display Range Limits: Monitor ranges (GTF): 56-76 Hz V, 30-83 kHz H, max dotclock 170 MHz Extension blocks: 1Checksum: 0x8f----------------Block 1, CTA-861 Extension Block: Revision: 3 Underscans IT Video Formats by default Supports YCbCr 4:4:4 Supports YCbCr 4:2:2 Native detailed modes: 1 Video Data Block: VIC 16: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz (native) VIC 5: 1920x1080i 60.000000 Hz 16:9 33.750 kHz 74.250000 MHz VIC 4: 1280x720 60.000000 Hz 16:9 45.000 kHz 74.250000 MHz VIC 3: 720x480 59.940060 Hz 16:9 31.469 kHz 27.000000 MHz VIC 2: 720x480 59.940060 Hz 4:3 31.469 kHz 27.000000 MHz VIC 7: 1440x480i 59.940060 Hz 16:9 15.734 kHz 27.000000 MHz VIC 6: 1440x480i 59.940060 Hz 4:3 15.734 kHz 27.000000 MHz VIC 31: 1920x1080 50.000000 Hz 16:9 56.250 kHz 148.500000 MHz VIC 20: 1920x1080i 50.000000 Hz 16:9 28.125 kHz 74.250000 MHz VIC 19: 1280x720 50.000000 Hz 16:9 37.500 kHz 74.250000 MHz VIC 18: 720x576 50.000000 Hz 16:9 31.250 kHz 27.000000 MHz VIC 17: 720x576 50.000000 Hz 4:3 31.250 kHz 27.000000 MHz VIC 22: 1440x576i 50.000000 Hz 16:9 15.625 kHz 27.000000 MHz VIC 21: 1440x576i 50.000000 Hz 4:3 15.625 kHz 27.000000 MHz VIC 1: 640x480 59.940476 Hz 4:3 31.469 kHz 25.175000 MHz Vendor-Specific Data Block (HDMI), OUI 00-0C-03: Source physical address: 1.0.0.0 Detailed Timing Descriptors: DTD 2: 1920x1080 60.000000 Hz 16:9 67.500 kHz 148.500000 MHz (476 mm x 268 mm) Hfront 88 Hsync 44 Hback 148 Hpol P Vfront 4 Vsync 5 Vback 36 Vpol P DTD 3: 1920x1080i 60.000000 Hz 16:9 33.750 kHz 74.250000 MHz (476 mm x 268 mm) Hfront 88 Hsync 44 Hback 148 Hpol P Vfront 2 Vsync 5 Vback 15 Vpol P Vfront +0.5 Odd Field Vfront 2 Vsync 5 Vback 15 Vpol P Vback +0.5 Even Field DTD 4: 1280x720 60.000000 Hz 16:9 45.000 kHz 74.250000 MHz (476 mm x 268 mm) Hfront 110 Hsync 40 Hback 220 Hpol P Vfront 5 Vsync 5 Vback 20 Vpol P DTD 5: 1920x1080 50.000000 Hz 16:9 56.250 kHz 148.500000 MHz (476 mm x 268 mm) Hfront 528 Hsync 44 Hback 148 Hpol P Vfront 4 Vsync 5 Vback 36 Vpol PChecksum: 0xee
5. View Monitor Information using dmesg
You can check the kernel logs for information about your monitor.
To do so, run:
sudo dmesg | grep -i hdmi
Or,
sudo dmesg | grep -i drm
Look for lines that mention the resolution or refresh rate.
Discover Desktop Screen Resolution in Linux from GUI
1. Using gnome-display
If you’re using a GNOME-based desktop environment (e.g., Ubuntu, Fedora), you can use theSettingsapp to check the resolution and refresh rate.
- Open Settings > Displays.
- The current resolution and refresh rate will be displayed under the monitor’s settings.
2. Using arandr
arandris a graphical front-end forxrandrthat allows you to view and manage display settings.
Install arandr:
sudo apt install arandr
Launch arandr from your application menu or by running:
arandr
The current resolution and refresh rate will be displayed in the window. If not, go to Outputs -> DP1 or DP2 or HDMI -> Resolution from arandr window.
Which Method Should You Use?
If you want to quickly check the current resolution and refresh rate, use xrandr. The xrandr command is the more powerful of the all methods. This is the fastest and simplest way to see the current resolution and refresh rate, as well as all supported modes.
If you want detailed monitor information (e.g., Model, Physical Size, Supported Features), Use edid-decode.
If you want to an easier method, use the xdpyinfo command. Please note that it does not provide as much information.
If you want to check system-wide display information, use Inxi. This provides a summary of your graphics card and monitor details, including resolution and refresh rate.
My Recommendation:
- Start with xrandr to quickly check the current resolution and refresh rate, as well as supported modes.
- If you need more details (e.g., monitor model, physical size), use edid-decode.
- If you prefer a graphical interface, use gnome-display or arandr.
Frequently Asked Questions
Q: How can I find my Linux desktop screen resolution using the command line?A: You have two main options: using the "xrandr" command or the "xdpyinfo" command. These commands provide detailed information about your display setup, including the screen resolution.
Q: How do I use the "xrandr" command to find my screen resolution and refresh rate?A: Open a terminal and type "xrandr" without quotes, then press Enter. Look for the line that corresponds to your primary monitor, which typically contains the screen resolution and refresh rateinformation.
Q: How to determine screen resolution using the "xdpyinfo" command?A: Open a terminal and type "xdpyinfo | grep dimensions" without quotes, then press Enter. The terminal will display the screen resolution of your current display.
Q: Can I extract only the screen resolution and exclude other details?A: Yes, you can. Use the command "xrandr | grep '*' | awk '{ print $1 }'" for "xrandr," and "xdpyinfo | grep dimensions | awk '{print $2}'" for "xdpyinfo." These commands will display only the screen resolution.
Q: Can I change my screen resolution using the command line?A: Yes, both "xrandr" and "xdpyinfo" can be used to change screen resolution. However, "xrandr" is the primary command for configuring display settings, including resolution changes.
Q: How do I check my monitor's physical size and model information?A: Use the edid-decode tool to read the EDID (Extended Display Identification Data) from your monitor: sudo cat /sys/class/drm/card0-DP-2/edid | edid-decode
Q: How do I check my monitor's details using inxi?A: Run the following command to display monitor information: inxi -G
Q: What if I'm using a different Linux distribution? Will the commands be the same?A: The commands themselves are likely to remain similar, but the package names and installation methods might vary depending on your distribution. Consult your distribution's package manager or documentation for precise instructions.
Conclusion
Find your desktop screen resolution from the CLI and GUI in Linux is easy! By using these tools and methods, you can easily check your monitor's current resolution and refresh rate, as well as its supported modes.
위 내용은 CLI 및 GUI에서 Linux 데스크탑 화면 해상도를 찾는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

Linux의 주요 용도에는 다음이 포함됩니다. 1. 서버 운영 체제, 2. 임베디드 시스템, 3. 데스크탑 운영 체제, 4. 개발 및 테스트 환경. Linux는이 분야에서 뛰어나 안정성, 보안 및 효율적인 개발 도구를 제공합니다.

인터넷은 단일 운영 체제에 의존하지 않지만 Linux는 이에 중요한 역할을합니다. Linux는 서버 및 네트워크 장치에서 널리 사용되며 안정성, 보안 및 확장 성으로 인기가 있습니다.

Linux 운영 체제의 핵심은 명령 줄 인터페이스이며 명령 줄을 통해 다양한 작업을 수행 할 수 있습니다. 1. 파일 및 디렉토리 작업 LS, CD, MKDIR, RM 및 기타 명령을 사용하여 파일 및 디렉토리를 관리합니다. 2. 사용자 및 권한 관리는 UserAdd, Passwd, CHMOD 및 기타 명령을 통해 시스템 보안 및 리소스 할당을 보장합니다. 3. 프로세스 관리는 PS, Kill 및 기타 명령을 사용하여 시스템 프로세스를 모니터링하고 제어합니다. 4. 네트워크 운영에는 Ping, Ifconfig, SSH 및 기타 명령이 포함되어 있으며 네트워크 연결을 구성하고 관리합니다. 5. 시스템 모니터링 및 유지 관리 Top, DF, Du와 같은 명령을 사용하여 시스템의 작동 상태 및 리소스 사용을 이해합니다.

소개 Linux는 유연성과 효율성으로 인해 개발자, 시스템 관리자 및 전원 사용자가 선호하는 강력한 운영 체제입니다. 그러나 길고 복잡한 명령을 자주 사용하는 것은 지루하고 응급실이 될 수 있습니다.

Linux는 서버, 개발 환경 및 임베디드 시스템에 적합합니다. 1. 서버 운영 체제로서 Linux는 안정적이고 효율적이며 종종 고 대전성 애플리케이션을 배포하는 데 사용됩니다. 2. 개발 환경으로서 Linux는 효율적인 명령 줄 도구 및 패키지 관리 시스템을 제공하여 개발 효율성을 향상시킵니다. 3. 임베디드 시스템에서 Linux는 가볍고 사용자 정의 가능하며 자원이 제한된 환경에 적합합니다.

소개 : Linux 기반의 윤리적 해킹으로 디지털 프론티어 보안 점점 더 상호 연결된 세상에서 사이버 보안이 가장 중요합니다. 윤리적 해킹 및 침투 테스트는 취약점을 적극적으로 식별하고 완화하는 데 필수적입니다.

기본 Linux 학습 방법은 다음과 같습니다. 1. 파일 시스템 및 명령 줄 인터페이스 이해, 2. LS, CD, MKDIR, 3. 파일 생성 및 편집과 같은 파일 작업 배우기, 4. 파이프 라인 및 GREP 명령과 같은 고급 사용법, 5. 연습 및 탐색을 통해 지속적으로 기술을 향상시킵니다.

Linux는 서버, 임베디드 시스템 및 데스크탑 환경에서 널리 사용됩니다. 1) 서버 필드에서 Linux는 안정성 및 보안으로 인해 웹 사이트, 데이터베이스 및 응용 프로그램을 호스팅하기에 이상적인 선택이되었습니다. 2) 임베디드 시스템에서 Linux는 높은 사용자 정의 및 효율성으로 인기가 있습니다. 3) 데스크탑 환경에서 Linux는 다양한 사용자의 요구를 충족시키기 위해 다양한 데스크탑 환경을 제공합니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

안전한 시험 브라우저
안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

SublimeText3 영어 버전
권장 사항: Win 버전, 코드 프롬프트 지원!

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기
