03 開始使用openEuler操作系統(tǒng)
3.1 目標(biāo)
開始使用openEuler操作系統(tǒng),能夠區(qū)分GUI與CLI、學(xué)習(xí)Linux的兩種登錄方式、了解登錄界面各項(xiàng)參數(shù)的含義、使用了解shell以及一些基礎(chǔ)的快捷鍵、使用命令查看基本的系統(tǒng)信息。
3.2 Linux以及openEuler中的GUI與CLI
- GUI(Graphical User Interface,圖形用戶界面),可以讓用戶使用鼠標(biāo)作為輸入工具,來進(jìn)行各項(xiàng)操作。
- CLI(Command Line Interface,命令行界面),用戶界面字符化,用戶可以使用鍵盤作為輸入工具,來使用命令進(jìn)行各項(xiàng)操作。
- openEuler目前默認(rèn)沒有GUI界面,使用bash shell作為默認(rèn)shell的CLI環(huán)境。
- openEuler支持安裝UKUI、DDE、XFCE、GNOME的GUI環(huán)境。
3.3 Linux的兩種登錄方式
3.3.1 本地登錄
- 控制臺打開顯示器,便可在本地輸入賬號密碼進(jìn)行登錄。(**注意:**Linux在輸入密碼時為不顯示狀態(tài),這屬于正常情況)。
- 對于沒有啟用或者安裝GUI的,我們可以使用Ctrl+Alt+F[1-6]在1-6號虛擬控制臺進(jìn)行切換(默認(rèn)登錄為1號控制臺)。
- 對于安裝了GUI的操作系統(tǒng),1號控制臺為用戶選擇界面,2號控制臺為GUI桌面,3-6號為4個CLI虛擬控制臺,一樣可以使用Ctrl+Alt+F[1-6]進(jìn)行切換。
3.3.2 遠(yuǎn)程登陸
-
openEuler等諸多l(xiāng)inux都支持ssh的遠(yuǎn)程登陸,當(dāng)然也可以關(guān)閉。
-
在SecureCRT、Xshell、PuTTY及各種linux cli使用”ssh username@ip/主機(jī)名/域名(其中“/”為或的關(guān)系,如果要使用主機(jī)名,則要保證hosts文件中有定義,如果要使用域名進(jìn)行登錄,則要保證域名解析可達(dá))。
-
遠(yuǎn)程登陸端口默認(rèn)為22,如果有做修改,在linux中可以使用”ssh username@ip/主機(jī)名/域名 -p 端口號”來進(jìn)行登錄。
-
一些系統(tǒng)為了增強(qiáng)遠(yuǎn)程登陸的系統(tǒng)安全性,會不允許使用賬號以及密碼進(jìn)行登陸,而使用公鑰進(jìn)行身份驗(yàn)證,當(dāng)設(shè)置密鑰配對成功時,則不需要密碼便可以登陸成功。
3.4 退出登錄(注銷)
- 值得注意的是,不管是遠(yuǎn)程登陸還是本地登錄想要退出當(dāng)前登錄時,我們可以使用
exit
或者Ctrl+d
進(jìn)行退出。
3.5 openEuler登錄界面參數(shù)解析
Authorized users only. All activities may be monitored and reported.
Authorized users only. All activities may be monitored and reported.
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Mon Nov 28 22:28:57 2022
Welcome to 5.10.0-60.18.0.50.oe2203.x86_64
System information as of time: 2022年 11月 28日 星期一 22:33:35 CST
System load: 0.00
Processes: 153
Memory used: 8.5%
Swap used: 0%
Usage On: 7%
IP address: 192.168.0.21
IP address: 192.168.122.1
Users online: 2
[root@scfuture-21 ~]#
-
System load為系統(tǒng)最近1分鐘的平均負(fù)載(越接近n代表負(fù)載越高,n代表操作系統(tǒng)cpu的核數(shù));
-
Processes代表正在跑的進(jìn)程數(shù)量;
-
Memory used代表內(nèi)存使用量的百分比;
-
Swap used 代表Swap交換分區(qū)使用量的百分比;
-
Usage On代表了根分區(qū)的使用率;
-
IP address代表當(dāng)前ip地址;
-
Users online代表當(dāng)前連接的用戶數(shù)。
此開機(jī)腳本被定義在/etc/profile.d/system-info.sh中。
[root@scfuture-21 ~]# cat /etc/profile.d/system-info.sh
#/bin/bash
#Copyright (c) [2019] Huawei Technologies Co., Ltd.
#generic-release is licensed under the Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v2 for more details.
# Welcome
welcome=$(uname -r)
# Memory
memory_total=$(cat /proc/meminfo | awk '/^MemTotal:/ {printf($2)}')
memory_free=$(cat /proc/meminfo | awk '/^MemFree:/ { printf($2)}')
buffers=$(cat /proc/meminfo | awk '/^Buffers:/ { printf($2)}')
cached=$(cat /proc/meminfo | awk '/^Cached:/ { printf($2)}')
sreclaimable=$(cat /proc/meminfo | awk '/^SReclaimable:/ { printf($2)}')
swap_total=$(cat /proc/meminfo | awk '/^SwapTotal:/ { printf($2)}')
swap_free=$(cat /proc/meminfo | awk '/^SwapFree:/ { printf($2)}')
if [ $memory_total -gt 0 ]
then
memory_usage=`echo "scale=1; ($memory_total - $memory_free - $buffers - $cached - $sreclaimable) * 100.0 / $memory_total" |bc`
memory_usage="$1.19MB%"
else
memory_usage=0.0%
fi
# Swap memory
if [ $swap_total -gt 0 ]
then
swap_mem=`echo "scale=1; ($swap_total - $swap_free) * 100.0 / $swap_total" |bc`
swap_mem="${swap_mem}%"
else
swap_mem=0.0%
fi
# Usage
usageof=$(df -h / | awk '/\// {print $(NF-1)}')
# System load
load_average=$(awk '{print $1}' /proc/loadavg)
# WHO I AM
whoiam=$(whoami)
# Time
time_cur=$(date)
# Processes
processes=$(ps aux | wc -l)
# Users
user_num=$(users | wc -w)
# Ip address
ip_pre=""
if [ -x "/sbin/ip" ]
then
ip_pre=$(/sbin/ip a | grep inet | grep -v "127.0.0.1" | grep -v inet6 | awk '{print $2}')
fi
echo -e "\n"
echo -e "Welcome to $welcome\n"
echo -e "System information as of time: \t$time_cur\n"
echo -e "System load: \t\033[0;33;40m$load_average\033[0m"
echo -e "Processes: \t$processes"
echo -e "Memory used: \t$memory_usage"
echo -e "Swap used: \t$swap_mem"
echo -e "Usage On: \t$usageof"
for line in $ip_pre
do
ip_address=${line%/*}
echo -e "IP address: \t$ip_address"
done
echo -e "Users online: \t$user_num"
if [ "$whoiam" == "root" ]
then
echo -e "\n"
else
echo -e "To run a command as administrator(user \"root\"),use \"sudo <command>\"."
fi
[root@scfuture-21 ~]#
3.6 Shell以及openEuler中Shell的簡介
-
Shell是一種c語言編寫的命令解釋程序。
-
常見的Shell有bash、sh、csh、ksh,通??梢酝ㄟ^輸入shell名來切換不同shell,并可以使用exit命令退回原來的shell。
[root@scfuture-21 ~]# sh
sh-5.1# exit
exit
[root@scfuture-21 ~]#
- openEuler默認(rèn)的shell為bash。
[root@scfuture-21 ~]# echo $SHELL
/bin/bash
[root@scfuture-21 ~]#
- 值得一提的是,bash shell率先實(shí)現(xiàn)了許多高級功能,如tab補(bǔ)全、文件夾&可執(zhí)行文件高亮等,故一般linux均采用bash為默認(rèn)shell。同時bash解釋程序也足夠輕量,只有1.2mb左右。
[root@scfuture-21 ~]# ll -h /bin/bash
-rwxr-xr-x. 1 root root 1.2M 12月 2 2021 /bin/bash
[root@scfuture-21 ~]#
- Shell的默認(rèn)系統(tǒng)提示符為:[username@hostname current_directory]# 或者[username@hostname current_directory]$ (注意,#代表超級用戶,KaTeX parse error: Expected 'EOF', got '#' at position 20: …用戶,判斷是否為超級用戶可以從#?還是來判斷,不能使用用戶名判斷!)。
[root@scfuture-21 ~]#
[root@scfuture-21 ~]# su - superman
Welcome to 5.10.0-60.18.0.50.oe2203.x86_64
System information as of time: 2022年 11月 28日 星期一 22:40:19 CST
System load: 0.00
Processes: 151
Memory used: 8.6%
Swap used: 0%
Usage On: 7%
IP address: 192.168.0.21
IP address: 192.168.122.1
Users online: 2
To run a command as administrator(user "root"),use "sudo <command>".
[superman@scfuture-21 ~]$
3.7 使用命令查看基本的系統(tǒng)信息
- 查看系統(tǒng)信息,命令如下:
# cat /etc/os-release
例如,命令和輸出如下:
[root@scfuture-21 ~]# cat /etc/os-release
NAME="openEuler"
VERSION="22.03 LTS"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 LTS"
ANSI_COLOR="0;31"
[root@scfuture-21 ~]#
- 查看CPU信息,命令如下:
方法一:
[root@scfuture-21 ~]# lscpu
架構(gòu): x86_64
CPU 運(yùn)行模式: 32-bit, 64-bit
Address sizes: 45 bits physical, 48 bits virtual
字節(jié)序: Little Endian
CPU: 2
在線 CPU 列表: 0,1
廠商 ID: GenuineIntel
BIOS Vendor ID: GenuineIntel
型號名稱: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
BIOS Model name: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
CPU 系列: 6
型號: 142
每個核的線程數(shù): 1
每個座的核數(shù): 2
座: 1
步進(jìn): 10
BogoMIPS: 3600.00
標(biāo)記: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp
lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2api
c movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibp
b stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves arat md_clear f
lush_l1d arch_capabilities
Virtualization features:
超管理器廠商: VMware
虛擬化類型: 完全
Caches (sum of all):
L1d: 64 KiB (2 instances)
L1i: 64 KiB (2 instances)
L2: 512 KiB (2 instances)
L3: 6 MiB (1 instance)
NUMA:
NUMA 節(jié)點(diǎn): 1
NUMA 節(jié)點(diǎn)0 CPU: 0,1
Vulnerabilities:
Itlb multihit: KVM: Mitigation: VMX unsupported
L1tf: Mitigation; PTE Inversion
Mds: Mitigation; Clear CPU buffers; SMT Host state unknown
Meltdown: Mitigation; PTI
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP disabled, RSB filling
Srbds: Unknown: Dependent on hypervisor status
Tsx async abort: Not affected
[root@scfuture-21 ~]#
方法二:
[root@scfuture-21 ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1800.003
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves arat md_clear flush_l1d arch_capabilities
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips : 3600.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 142
model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1800.003
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves arat md_clear flush_l1d arch_capabilities
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds
bogomips : 3600.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
[root@scfuture-21 ~]#
方法三:
[root@scfuture-21 ~]# top
top - 22:47:03 up 1:02, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 145 total, 1 running, 144 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.2 hi, 0.0 si, 0.0 st
MiB Mem : 3380.5 total, 2539.1 free, 284.5 used, 556.8 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 2735.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13920 root 20 0 9904 3984 3284 R 0.3 0.1 0:00.03 top
1 root 20 0 168900 17020 8780 S 0.0 0.5 0:01.94 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
5 root 20 0 0 0 0 I 0.0 0.0 0:02.61 kworker/0:0-ata_sff
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_rude_
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_trace
11 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
12 root 20 0 0 0 0 I 0.0 0.0 0:02.32 rcu_sched
13 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
16 root rt 0 0 0 0 S 0.0 0.0 0:00.12 migration/1
17 root 20 0 0 0 0 S 0.0 0.0 0:00.14 ksoftirqd/1
19 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0H-events_highpri
22 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kdevtmpfs
23 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns
24 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper
31 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback
32 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kcompactd0
33 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
[root@scfuture-21 ~]#
[root@scfuture-21 ~]# top -----執(zhí)行top后輸入1
top - 22:47:35 up 1:03, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 145 total, 1 running, 144 sleeping, 0 stopped, 0 zombie
%Cpu0 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu1 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3380.5 total, 2539.1 free, 284.5 used, 556.8 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 2735.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12 root 20 0 0 0 0 I 0.3 0.0 0:02.37 rcu_sched
790 root 20 0 79156 1612 1368 S 0.3 0.0 0:00.31 irqbalance
1 root 20 0 168900 17020 8780 S 0.0 0.5 0:01.94 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
5 root 20 0 0 0 0 I 0.0 0.0 0:02.61 kworker/0:0-ata_sff
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_rude_
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_trace
11 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
13 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
16 root rt 0 0 0 0 S 0.0 0.0 0:00.12 migration/1
17 root 20 0 0 0 0 S 0.0 0.0 0:00.14 ksoftirqd/1
19 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0H-events_highpri
22 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kdevtmpfs
23 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns
24 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper
31 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback
32 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kcompactd0
[root@scfuture-21 ~]#
- 查看內(nèi)存信息,命令如下:
方法一:
[root@scfuture-21 ~]# free
total used free shared buff/cache available
Mem: 3461636 291740 2600036 9308 569860 2800348
Swap: 8388604 0 8388604
[root@scfuture-21 ~]#
方法二:
[root@scfuture-21 ~]# top
top - 22:50:07 up 1:05, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 145 total, 2 running, 143 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.2 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.2 hi, 0.0 si, 0.0 st
MiB Mem : 3380.5 total, 2538.6 free, 285.0 used, 556.9 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 2734.6 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13895 root 20 0 0 0 0 I 0.3 0.0 0:00.56 kworker/1:1-events
1 root 20 0 168900 17020 8780 S 0.0 0.5 0:01.94 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
5 root 20 0 0 0 0 I 0.0 0.0 0:02.61 kworker/0:0-ata_sff
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_rude_
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_tasks_trace
11 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
12 root 20 0 0 0 0 R 0.0 0.0 0:02.50 rcu_sched
13 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
16 root rt 0 0 0 0 S 0.0 0.0 0:00.12 migration/1
17 root 20 0 0 0 0 S 0.0 0.0 0:00.14 ksoftirqd/1
19 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0H-events_highpri
22 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kdevtmpfs
23 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns
24 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper
31 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback
32 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kcompactd0
33 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
[root@scfuture-21 ~]#
[root@scfuture-21 ~]# top -----執(zhí)行top后輸入M
top - 22:49:49 up 1:05, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 145 total, 1 running, 144 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.2 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st
MiB Mem : 3380.5 total, 2539.1 free, 284.5 used, 556.9 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 2735.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
895 root 20 0 132164 42332 17984 S 0.0 1.2 0:00.90 firewalld
1533 root 20 0 331972 26280 12468 S 0.3 0.8 0:00.67 lvmdbusd
999 root 20 0 258036 24972 12012 S 0.0 0.7 0:00.92 tuned
789 polkitd 20 0 2590004 23236 18644 S 0.0 0.7 0:00.18 polkitd
978 root 20 0 258144 20636 17680 S 0.0 0.6 0:00.27 NetworkManager
1 root 20 0 168900 17020 8780 S 0.0 0.5 0:01.94 systemd
756 root 20 0 29400 10068 7028 S 0.0 0.3 0:00.27 systemd-udevd
677 root 20 0 22460 9256 8300 S 0.0 0.3 0:00.16 systemd-journal
818 root 20 0 15852 9004 6556 S 0.0 0.3 0:00.09 systemd-logind
9057 root 20 0 15328 8612 7356 S 0.0 0.2 0:00.03 sshd
1295 root 20 0 163924 7552 3968 S 0.0 0.2 0:00.31 rsyslogd
822 root 20 0 14272 7236 6452 S 0.0 0.2 0:00.03 systemd-machine
3374 root 20 0 13896 6696 5872 S 0.0 0.2 0:00.00 sshd
795 root 20 0 89348 6072 5292 S 0.0 0.2 0:12.29 rngd
9062 root 20 0 9352 6016 3824 S 0.0 0.2 0:00.09 bash
8985 root 20 0 11792 5768 3728 S 0.0 0.2 0:00.02 bash
9061 root 20 0 15328 5488 4200 S 0.3 0.2 0:00.10 sshd
8978 root 20 0 9948 5416 4564 S 0.0 0.2 0:00.01 login
726 rpc 20 0 10884 5116 4444 S 0.0 0.1 0:00.03 rpcbind
777 dbus 20 0 7980 4936 3992 S 0.0 0.1 0:00.25 dbus-daemon
1000 root 20 0 55420 4136 3428 S 0.0 0.1 0:00.00 gssproxy
824 root 20 0 10864 4124 1260 S 0.0 0.1 0:00.00 restorecond
13922 root 20 0 9904 3996 3292 R 0.3 0.1 0:00.03 top
1361 root 20 0 7812 3268 2404 S 0.0 0.1 0:00.03 crond
732 root 16 -4 6984 3228 2680 S 0.0 0.1 0:00.01 sedispatch
2115 dnsmasq 20 0 8828 2444 2064 S 0.0 0.1 0:00.00 dnsmasq
[root@scfuture-21 ~]#
- 查看硬盤信息,命令如下:
方法一:
[root@scfuture-21 ~]# fdisk -l
Disk /dev/sda:50 GiB,53687091200 字節(jié),104857600 個扇區(qū)
磁盤型號:VMware Virtual S
單元:扇區(qū) / 1 * 512 = 512 字節(jié)
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤標(biāo)簽類型:dos
磁盤標(biāo)識符:0x4ff24c22
設(shè)備 啟動 起點(diǎn) 末尾 扇區(qū) 大小 Id 類型
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 104857599 102758400 49G 8e Linux LVM
Disk /dev/mapper/vg00-lv_root:41 GiB,44019220480 字節(jié),85975040 個扇區(qū)
單元:扇區(qū) / 1 * 512 = 512 字節(jié)
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
Disk /dev/mapper/vg00-lv_swap:8 GiB,8589934592 字節(jié),16777216 個扇區(qū)
單元:扇區(qū) / 1 * 512 = 512 字節(jié)
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
[root@scfuture-21 ~]#
方法二:
[root@scfuture-21 ~]# df
文件系統(tǒng) 1K-塊 已用 可用 已用% 掛載點(diǎn)
devtmpfs 1713420 0 1713420 0% /dev
tmpfs 1730816 12 1730804 1% /dev/shm
tmpfs 692328 9288 683040 2% /run
tmpfs 4096 0 4096 0% /sys/fs/cgroup
/dev/mapper/vg00-lv_root 42001520 2532084 37303676 7% /
tmpfs 1730820 0 1730820 0% /tmp
/dev/sda1 996780 89696 838272 10% /boot
[root@scfuture-21 ~]#
[root@scfuture-21 ~]# df -h
文件系統(tǒng) 容量 已用 可用 已用% 掛載點(diǎn)
devtmpfs 1.7G 0 1.7G 0% /dev
tmpfs 1.7G 12K 1.7G 1% /dev/shm
tmpfs 677M 9.1M 668M 2% /run
tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup
/dev/mapper/vg00-lv_root 41G 2.5G 36G 7% /
tmpfs 1.7G 0 1.7G 0% /tmp
/dev/sda1 974M 88M 819M 10% /boot
[root@scfuture-21 ~]#
方法三:
[root@scfuture-21 ~]# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=1713420k,nr_inodes=428355,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,size=692328k,nr_inodes=819200,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,size=4096k,nr_inodes=1024,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,rdma)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices)
cgroup on /sys/fs/cgroup/files type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,files)
/dev/mapper/vg00-lv_root on / type ext4 (rw,relatime,seclabel)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,nosuid,noexec,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18845)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime,seclabel)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime,seclabel)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime,seclabel)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel,size=1730820k,nr_inodes=1048576)
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
[root@scfuture-21 ~]#
- 查看ip信息,命令如下:
方法一:
[root@scfuture-21 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.21 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::9393:f6ae:ced9:7759 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:96:c9:d7 txqueuelen 1000 (Ethernet)
RX packets 42632 bytes 60931074 (58.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9811 bytes 646374 (631.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:bc:bb:cd txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@scfuture-21 ~]#
方法二:文章來源:http://www.zghlxwxcb.cn/news/detail-786391.html
[root@scfuture-21 ~]# ip add list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:96:c9:d7 brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 192.168.0.21/24 brd 192.168.0.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::9393:f6ae:ced9:7759/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:bc:bb:cd brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:bc:bb:cd brd ff:ff:ff:ff:ff:ff
[root@scfuture-21 ~]#
方法三:文章來源地址http://www.zghlxwxcb.cn/news/detail-786391.html
[root@scfuture-21 ~]# hostname -I
192.168.0.21 192.168.122.1
[root@scfuture-21 ~]#
到了這里,關(guān)于03 開始使用openEuler操作系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!