250430

タスクマネージャー

hitto@mdns:/usr/bin$ top

top - 04:54:59 up 6 days, 15:50,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 102 total,   1 running, 101 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  3.7 sy,  0.0 ni, 96.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st 
MiB Mem :   1967.5 total,    478.8 free,    363.8 used,   1316.4 buff/cache     
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   1603.7 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                             
      1 root      20   0   23180  14652  10172 S   0.0   0.7   0:15.98 /sbin/init                                                                                                          
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.05 [kthreadd]                                                                                                          
      3 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [pool_workqueue_release]                                                                                            
      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-rcu_gp]                                                                                                  
      5 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-sync_wq]                                                                                                 
      6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-slub_flushwq]                                                                                            
      7 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-netns]                                                                                                   
     10 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/0:0H-events_highpri]                                                                                       
     12 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-mm_percpu_wq]                                                                                            
     13 root      20   0       0      0      0 I   0.0   0.0   0:00.00 [rcu_tasks_kthread]                                                                                                 
     14 root      20   0       0      0      0 I   0.0   0.0   0:00.00 [rcu_tasks_rude_kthread]                                                                                            
     15 root      20   0       0      0      0 I   0.0   0.0   0:00.00 [rcu_tasks_trace_kthread]                                                                                           
     16 root      20   0       0      0      0 S   0.0   0.0   0:01.42 [ksoftirqd/0]                                                                                                       
     17 root      20   0       0      0      0 I   0.0   0.0   0:34.91 [rcu_preempt]                                                                                                       
     18 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [rcu_exp_par_gp_kthread_worker/0]                                                                                   
     19 root      20   0       0      0      0 S   0.0   0.0   0:00.01 [rcu_exp_gp_kthread_worker]                                                                                         
     20 root      rt   0       0      0      0 S   0.0   0.0   0:03.19 [migration/0]                                                                                                       
     21 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 [idle_inject/0]                                                                                                     
     22 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [cpuhp/0]                                                                                                           
     23 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [kdevtmpfs]                                                                                                         
     24 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-inet_frag_wq]                                                                                            
     26 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [kauditd]                                                                                                           
     27 root      20   0       0      0      0 S   0.0   0.0   0:00.12 [khungtaskd]                                                                                                        
     28 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [oom_reaper]                                                                                                        
     30 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-writeback]                                                                                               
     31 root      20   0       0      0      0 S   0.0   0.0   0:18.20 [kcompactd0]                                                                                                        
     32 root      25   5       0      0      0 S   0.0   0.0   0:00.00 [ksmd]                                                                                                              
     33 root      39  19       0      0      0 S   0.0   0.0   0:00.00 [khugepaged]                                                                                                        
     34 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-kintegrityd]                                                                                             
     35 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-kblockd]                                                                                                 
     36 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-blkcg_punt_bio]                                                                                          
     37 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 [irq/9-acpi]                                                                                                        
     38 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-tpm_dev_wq]                                                                                              
     39 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-ata_sff]                                                                                                 
     40 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-md]                                                                                                      
     41 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-md_bitmap]                                                                                               
     42 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-edac-poller]                                                                                             
     43 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-devfreq_wq]                                                                                              
     44 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 [watchdogd]                                                                                                         
     45 root       0 -20       0      0      0 I   0.0   0.0   0:02.35 [kworker/0:1H-kblockd]                                                                                              
     46 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [kswapd0]                                                                                                           
     47 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [ecryptfs-kthread]                                                                                                  
     48 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-kthrotld]                                                                                                
     49 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [kworker/R-acpi_thermal_pm]                                                                                         
     50 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [scsi_eh_0]                                                                                                         

hitto@mdns:/usr/bin$ vmstat 5
procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st gu
 1  0      0 490312 101488 1246524    0    0     1     7   39    0  0  0 100  0  0  0
 0  0      0 490312 101488 1246564    0    0     0    66   83   90  0  0 99  0  0  0
 0  0      0 490312 101488 1246564    0    0     0     6   45   60  0  0 100  0  0  0
 0  0      0 490312 101488 1246564    0    0     0     0   40   58  0  0 100  0  0  0
 0  0      0 490312 101488 1246564    0    0     0    27   54   72  0  0 100  0  0  0
 0  0      0 490312 101488 1246564    0    0     0     0   42   60  0  0 100  0  0  0
^C
hitto@mdns:/usr/bin$ 

cpuinfo

hitto@mdns:/usr/bin$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 15
model		: 6
model name	: Common KVM processor
stepping	: 1
microcode	: 0x1
cpu MHz		: 2399.998
cache size	: 16384 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
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 syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown bhi
bogomips	: 4799.99
clflush size	: 64
cache_alignment	: 128
address sizes	: 40 bits physical, 48 bits virtual
power management:

bogomips: 起動時にbogo(いかれた)mips(mi % sec)意味のないforを回して何回実行されたかを書いている。あまり当てにならない

tree

hitto@mdns:/usr/local$ ls
bin  etc  games  include  lib  libexec  man  sbin  share  src

ユーザーが作ったプログラムを入れるらしい

hitto@mdns:/usr

コマンドラインから実行するコマンドがある

hitto@mdns:/etc$ ls
ModemManager            cron.monthly          group-           libblockdev     multipath.conf          pollinate      services           ubuntu-advantage
PackageKit              cron.weekly           grub.d           libibverbs.d    nanorc                  profile        sgml               ucf.conf
X11                     cron.yearly           gshadow          libnl-3         needrestart             profile.d      shadow             udev
adduser.conf            crontab               gshadow-         locale.alias    netconfig               protocols      shadow-            udisks2
alternatives            cryptsetup-initramfs  gss              locale.conf     netplan                 python3        shells             ufw
apparmor                crypttab              hdparm.conf      locale.gen      network                 python3.12     skel               update-manager
apparmor.d              dbus-1                host.conf        localtime       networkd-dispatcher     qemu           sos                update-motd.d
apport                  debconf.conf          hostname         logcheck        networks                rc0.d          ssh                update-notifier
apt                     debian_version        hosts            login.defs      newt                    rc1.d          ssl                usb_modeswitch.conf
avahi                   default               hosts.allow      logrotate.conf  nftables.conf           rc2.d          subgid             usb_modeswitch.d
bash.bashrc             deluser.conf          hosts.deny       logrotate.d     nginx                   rc3.d          subgid-            vconsole.conf
bash_completion         depmod.d              init.d           lsb-release     nsswitch.conf           rc4.d          subuid             vim
bash_completion.d       dhcp                  initramfs-tools  lvm             opt                     rc5.d          subuid-            vmware-tools
bindresvport.blacklist  dhcpcd.conf           inputrc          machine-id      os-release              rc6.d          sudo.conf          vtrgb
binfmt.d                dpkg                  iscsi            magic           overlayroot.conf        rcS.d          sudo_logsrvd.conf  wgetrc
byobu                   e2scrub.conf          issue            magic.mime      overlayroot.local.conf  resolv.conf    sudoers            xattr.conf
ca-certificates         environment           issue.net        manpath.config  pam.conf                rmt            sudoers.d          xdg
ca-certificates.conf    ethertypes            kernel           mdadm           pam.d                   rpc            supercat           xml
cloud                   fstab                 landscape        mime.types      passwd                  rsyslog.conf   sysctl.conf        zsh_command_not_found
console-setup           fuse.conf             ld.so.cache      mke2fs.conf     passwd-                 rsyslog.d      sysctl.d
credstore               fwupd                 ld.so.conf       modprobe.d      perl                    screenrc       sysstat
credstore.encrypted     gai.conf              ld.so.conf.d     modules         pki                     security       systemd
cron.d                  gnutls                ldap             modules-load.d  plymouth                selinux        terminfo
cron.daily              groff                 legal            mtab            pm                      sensors.d      timezone
cron.hourly             group                 libaudit.conf    multipath       polkit-1                sensors3.conf  tmpfiles.d
hitto@mdns:/etc$ 

いろんなプログラムの設定、起動条件などを入れる

目的	使うべきコマンド
起動直後のカーネルやハード情報	dmesg or cat /var/log/dmesg
伝統的なsyslog確認	cat /var/log/syslog
systemdの詳細なログ	journalctl(フィルタ機能あり)

log

共通鍵、公開鍵暗号

共通鍵

cpuパワーをくわない

公開鍵

cpuパワーいる

← Go home