我正在测试几个系统,我被要求查找系统正在运行的 CPU 以及它当前使用了多少 RAM。我已经使用命令 top 解决了这个问题。
top - 01:49:56 up 5:21, 2 users, load average: 0.10, 0.18, 0.23
Tasks: 185 total, 3 running, 182 sleeping, 0 stopped, 0 zombie
%Cpu(s): 4.1 us, 1.5 sy, 0.0 ni, 94.2 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st
KiB Mem: 2945180 total, 2788784 used, 156396 free, 639912 buffers
KiB Swap: 262140 total, 9408 used, 252732 free, 1216156 cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1893 aritrada 20 0 1432m 97m 28m S 9.3 3.4 2:36.60 compiz
1121 root 20 0 132m 25m 5328 S 5.6 0.9 5:39.31 Xorg
3030 aritrada 20 0 1025m 315m 38m R 5.6 11.0 13:31.12 firefox
2416 aritrada 20 0 526m 19m 12m S 1.7 0.7 0:09.72 gnome-terminal
18 root 20 0 0 0 0 S 0.3 0.0 0:00.41 ksoftirqd/3
1984 aritrada 20 0 400m 11m 8424 S 0.3 0.4 0:03.65 bamfdaemon
2006 aritrada 20 0 536m 27m 11m S 0.3 1.0 0:12.46 unity-panel-ser
6644 root 20 0 0 0 0 S 0.3 0.0 0:00.69 kworker/u:0
6861 root 20 0 0 0 0 S 0.3 0.0 0:00.71 kworker/0:0
6951 root 20 0 24800 1640 1164 R 0.3 0.1 0:00.14 top
我还被要求找到交换空间,我使用了命令 swapon -s
swapon -s 的输出已粘贴在下面:
Filename Type Size Used Priority
/host/ubuntu/disks/swap.disk file 262140 10264 -1
我还被要求查找我使用 commad lsmod 加载的驱动程序。lsmod 命令的输出已粘贴在下面:
Module Size Used by
nls_utf8 12557 1
isofs 39842 1
snd_hda_codec_hdmi 32007 1
joydev 17457 0
snd_hda_codec_idt 70209 1
btusb 18334 0
coretemp 13400 0
kvm_intel 132759 0
kvm 414070 1 kvm_intel
arc4 12529 2
brcmsmac 531848 0
mac80211 539908 1 brcmsmac
brcmutil 14755 1 brcmsmac
cfg80211 206566 2 brcmsmac,mac80211
cordic 12535 1 brcmsmac
dell_wmi 12681 0
sparse_keymap 13890 1 dell_wmi
bnep 18140 2
dell_laptop 17369 0
dcdbas 14438 1 dell_laptop
microcode 22803 0
snd_hda_intel 33491 3
snd_hda_codec 134212 3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel
snd_hwdep 13602 1 snd_hda_codec
snd_pcm 96580 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
snd_rawmidi 30512 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
rfcomm 46619 12
bluetooth 209199 22 btusb,bnep,rfcomm
intel_ips 18049 0
parport_pc 32688 0
psmouse 95552 0
serio_raw 13215 0
lpc_ich 17061 0
ppdev 17073 0
uvcvideo 76749 0
snd_seq 61521 2 snd_seq_midi,snd_seq_midi_event
videobuf2_core 32851 1 uvcvideo
videodev 120309 2 uvcvideo,videobuf2_core
videobuf2_vmalloc 12860 1 uvcvideo
videobuf2_memops 13368 1 videobuf2_vmalloc
bcma 35656 1 brcmsmac
snd_timer 29425 2 snd_pcm,snd_seq
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq
snd 78734 16 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 15047 1 snd
snd_page_alloc 18484 2 snd_hda_intel,snd_pcm
mei 40690 0
i915 520519 8
drm_kms_helper 46784 1 i915
drm 275528 4 i915,drm_kms_helper
i2c_algo_bit 13413 1 i915
video 19335 1 i915
wmi 19070 1 dell_wmi
mac_hid 13205 0
lp 17759 0
parport 46345 3 parport_pc,ppdev,lp
hid_generic 12493 0
usbhid 46947 0
hid 100366 2 hid_generic,usbhid
r8169 61650 0
最后但并非最不重要的一点是,我试图找出系统运行了多少小时,我尝试使用命令
01:58:12 up 5:29, 2 users, load average: 0.28, 0.32, 0.27
请让我知道我在上述每个活动中使用的命令是否正确。也请告诉我是否有更好的选择来执行上述活动。
提前致谢。