나는 항상 유닉스에서 시스템 자체에 대한 정보를 찾는 것이 어렵다는 것을 발견했습니다.
어떤 OS를 사용하고 있습니까 (사용 가능한 최신 빌드와 비교하기 위해 버전 번호 및 모두)?
어떤 데스크탑 환경을 사용하고 있습니까? KDE를 사용하는 경우 대부분의 프로그램은 K로 시작하고 KDE를 사용하고 있다고 말할 수 있지만 스크립트에서 쿼리하는 방법이 있어야합니다.
어떤 커널 버전을 사용하고 있습니까? (예를 들어, 저는 Fedora를 사용하고 있는데 어떤 Linux 커널 버전을 사용하고 있는지 알고 싶습니다.)
기본적으로 내가 놓친 것은이 모든 정보를 얻을 수있는 단일 지점/유틸리티입니다. 대부분의 경우 위의 솔루션 자체는 OS에 따라 다릅니다. 그런 다음 갇혀 있습니다.
커널 버전을 제공하는 uname -a
외에도 다음을 시도해 볼 수 있습니다.
lsb_release -idrc # distro, version, codename, long release name
GNOME 또는 KDE와 같은 대부분의 데스크탑 환경에는 현재 사용중인 것을 알려주는 "정보"또는 "정보"메뉴 옵션이 있으므로 실제로는 명령 줄이 필요하지 않습니다.
@milk가 지적했듯이 uname -a
그러면 내가 액세스 할 수있는 모든 UNIX에 대한 정보가 표시됩니다. 예를 들어 Linux의 경우 :
Linux localhost 2.6.33.6-147.2.4.fc13.x86_64 #1 SMP Fri Jul 23 17:14:44 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
FreeBSD에서 :
FreeBSD localhost 6.3-RELEASE-p3-jc1 FreeBSD 6.3-RELEASE-p3-jc1 #2: Thu Aug 7 14:36:29 PDT 2008 [email protected]:/usr/obj/usr/src/sys/jail7 i386
OpenSolaris에서 :
SunOS localhost 5.11 snv_134 i86pc i386 i86pc
데스크탑 환경 문제에 관한 한 echo $DESKTOP_SESSION
KDE 또는 GNOME에서 올바른 답을 찾으십시오.
어떤 배포판을 실행 중인지 알고 싶다면 사기꾼의 지름길은 cat /etc/*-version /etc/*-release
.
아마도 당신은 사용할 수 있습니다
uname -a
커널 버전 및 사용중인 OS에 대한 정보를 얻으려면.
Unix (GNU/Linux)에서 시스템에 대한 정보를 수집하려면 몇 가지 유용한 명령이 필요합니다.
운영 체제에 대한 정보
$ lsb_release -idrc
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
CPU 수, 코어, CPU 제품군 모델, CPU 캐시, 스레드, 프로세서 와 같은 CPU 아키텍처에 대한 정보
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 42
Model name: Intel(R) Pentium(R) CPU B960 @ 2.20GHz
Stepping: 7
CPU MHz: 1416.335
CPU max MHz: 2200.0000
CPU min MHz: 800.0000
BogoMIPS: 4390.07
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 2048K
NUMA node0 CPU(s): 0,1
커널, 시스템 하드웨어 이름 및 운영 체제에 대한 정보
$ uname -a
Linux localhost 3.16.0-4-AMD64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
호스트 이름
$ hostname
localhost
비공개 IP 주소 (ipv4 버전)
$ hostname -I
192.168.1.XX
공용 IP 주소 (ipv4 버전) (인터넷 연결 필요)
$ Dig +short myip.opendns.com @resolver1.opendns.com
91.202.144.118
시스템에 대한 정보 (하드웨어) (줄임)
$ Sudo dmidecode -t system
System Information
Manufacturer: Acer
Product Name: Aspire E1-531G
Version: V2.11
Serial Number: NXM7BEU0013010B0EF1601
UUID: 332A4CE1-CB4B-E211-87F5-20898452C545
Wake-up Type: Power Switch
SKU Number: Aspire E1-531G_064A_V2.11
Family: Type1Family
프로세서에 대한 정보 (줄임)
$Sudo dmidecode -t processor
Processor Information
Socket Designation: U3E1
Type: Central Processor
Family: Pentium
Manufacturer: Intel(R) Corporation
ID: A7 06 02 00 FF FB EB BF
Signature: Type 0, Family 6, Model 42, Stepping 7
Flags:
FPU (Floating-point unit on-chip)
********
VME (Virtual mode extension)
Version: Intel(R) Pentium(R) CPU B960 @ 2.20GHz
Voltage: 1.1 V
External Clock: 100 MHz
Max Speed: 4000 MHz
Current Speed: 2200 MHz
Status: Populated, Enabled
Upgrade: Socket rPGA988B
L1 Cache Handle: 0x000B
L2 Cache Handle: 0x000C
L3 Cache Handle: 0x000D
Serial Number: To Be Filled By O.E.M.
Asset Tag: To Be Filled By O.E.M.
Part Number: To Be Filled By O.E.M.
Core Count: 2
Core Enabled: 2
Thread Count: 2
Characteristics:
64-bit capable
Multi-Core
Execute Protection
Power/Performance Control
데스크탑 환경
환경 변수 "DESKTOP_SESSION"에 유지되는 데스크탑 환경의 이름입니다. 그러나 환경 변수 "DESKTOP_SESSION"이 "default"(내 경우) 인 경우 환경 변수 "XDG_CURRENT_DESKTOP"에서 값을 가져 오십시오.
$ echo $DESKTOP_SESSION
default
$ echo $XDG_CURRENT_DESKTOP
GNOME
내장 유틸리티가 없기 때문에 데스크탑 환경 버전을 감지하려면 더 많은 노력이 필요합니다. 이 명령은 Gnome Shell이 설치된 내 컴퓨터 만 테스트했지만 다른 인기있는 그래픽 데스크탑 환경 인 KDE, Mate, Cinnamon, LXDE, Xfce에서 작동해야합니다.
$ pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce" | egrep "-Shell$" | awk '{print $2}' | xargs apt-cache show
Package: gnome-Shell
Version: 3.14.4-1~deb8u1
Installed-Size: 6910
Maintainer: Debian GNOME Maintainers <[email protected]>
Architecture: AMD64
Depends: gir1.2-clutter-1.0 (>= 1.17), gir1.2-glib-2.0 (>= 1.39.90-4~), gir1.2-gtk-3.0 (>= 3.8), gir1.2-mutter-3.0 (>= 3.14.4), gir1.2-networkmanager-1.0, gir1.2-soup-5
Recommends: gkbd-capplet, gnome-contacts, gnome-control-center, gnome-user-guide, unzip, gdm3 (>= 3.10.0.1-3~)
Conflicts: gnome-screensaver (<< 3.6)
Breaks: fglrx-driver (<< 1:11-10), gdm3 (<< 3.10.0.1-3~), gnome-control-center (<< 1:3.0), gnome-session (<< 3.0), gnome-Tweak-tool (<< 3.5)
Description-en: graphical Shell for the GNOME desktop
The GNOME Shell provides core interface functions like switching
windows, launching applications or see your notifications. It takes
advantage of the capabilities of modern graphics hardware and
introduces innovative user interface concepts to provide a
delightful and easy to use experience. GNOME Shell is the defining
technology of the GNOME 3 user experience.
Description-md5: 51a5a94e6b632e350489b7b8d27ab9fc
Homepage: http://live.gnome.org/GnomeShell
Tag: implemented-in::c, implemented-in::ecmascript, interface::x11,
role::program, uitoolkit::gtk
Section: gnome
Priority: optional
Filename: pool/main/g/gnome-Shell/gnome-Shell_3.14.4-1~deb8u1_AMD64.deb
Size: 637652
MD5sum: 183a6bdcd8b34c6a56c09add66301d4a
SHA1: a11964152940a4a70e3d9ce93a6f21bb0a661379
SHA256: ff2ce3aa442012971ba5526f488568bbde6d53a8dbb71b95a587792e903033e3
화면 정보
$ xrandr --current
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.00*+
1360x768 59.80 59.96
1024x768 60.00
800x600 60.32 56.25
640x480 59.94
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
유사한 작업과 더 많은 기능을위한 좋은 도구가 필요하다면 "HardInfo"- https://github.com/ lpereira/hardinfo . 데비안 기반 시스템에 쉽게 설치할 수 있습니다.
Linux 시스템 용 시스템 프로파일 러 및 벤치 마크 도구
기반
운영 gnome-system-monitor
(패키지는 Debian, Ubuntu 및 Fedora에서 동일한 이름 임), System 탭을 클릭합니다.
데스크탑은 여러 개를 설치할 수 있고 다른 데스크탑에서 하나의 데스크탑에 속한 하나의 패키지를 실행할 수 있기 때문에 약간 어렵습니다. 또한 printenv DESKTOP_SESSION
내 데비안 시스템에서 default
만 출력합니다 (우분투와 페도라에서는 잘 작동합니다).
완전히 완벽하지는 않지만 절반 정도 :
xwininfo -root -children|grep kwin
xwininfo -root -children|grep gnome-panel
(그러나 kwin에서 gnome-panel을 사용하고 싶다면 ;-) 또한 Linux에서 매우 유용하다고 생각합니다.
cat /etc/issue
위의 모든 게시물을 기반으로 작성하고 간단한 스크립트를 실행할 수 있습니다.
#!/bin/bash
lsb_release -idrc ; printenv DESKTOP_SESSION ; uname -a
나에게주는 달리기
Distributor ID: LinuxMint
Description: Linux Mint 9 Isadora
Release: 9 Codename: isadora
gnome
Linux judas327 2.6.32-24-generic-pae #39-Ubuntu SMP Wed Jul 28 07:39:26 UTC 2010 i686 GNU/Linux