查看某个进程
ps -ef :查看系统进程
[root@localhost ~]# ps -efUID PID PPID C STIME TTY TIME CMDroot 1 0 0 16:34 ? 00:00:01 /usr/lib/systemd/systemd --switcroot 2 0 0 16:34 ? 00:00:00 [kthreadd]root 3 2 0 16:34 ? 00:00:00 [ksoftirqd/0]root 5 2 0 16:34 ? 00:00:00 [kworker/0:0H]root 6 2 0 16:34 ? 00:00:00 [kworker/u128:0]root 7 2 0 16:34 ? 00:00:00 [migration/0]root 8 2 0 16:34 ? 00:00:00 [rcu_bh]root 9 2 0 16:34 ? 00:00:00 [rcuob/0]root 10 2 0 16:34 ? 00:00:00 [rcuob/1]root 11 2 0 16:34 ? 00:00:00 [rcuob/2]root 12 2 0 16:34 ? 00:00:00 [rcuob/3]root 13 2 0 16:34 ? 00:00:00 [rcuob/4]root 14 2 0 16:34 ? 00:00:00 [rcuob/5]root 15 2 0 16:34 ? 00:00:00 [rcuob/6]root 16 2 0 16:34 ? 00:00:00 [rcuob/7]
ps -ef|grep -i vim :查看进程中 和 vim 相关的进程
[root@localhost ~]# ps -ef|grep -i vimroot 3324 3264 0 17:05 pts/0 00:00:00 vim initial-setup-ks.cfgroot 3356 3325 0 17:06 pts/1 00:00:00 grep --color=auto -i vim
杀死某个进程
第一步:找到需要操作的进程
[root@localhost ~]# ps -ef|grep -i vimroot 3420 3264 0 17:08 pts/0 00:00:00 vim initial-setup-ks.cfgroot 3430 3370 0 17:08 pts/1 00:00:00 grep --color=auto -i vim
第二步:根据pid,杀死相应进程
[root@localhost ~]# kill -9 3420[root@localhost ~]# ps -ef|grep -i vimroot 3432 3370 0 17:09 pts/1 00:00:00 grep --color=auto -i vim
查看网络配置
查看本机Ip地址
[root@localhost ~]# ifconfigeno16777736: flags=4163mtu 1500 inet 192.168.63.133 netmask 255.255.255.0 broadcast 192.168.63.255 inet6 fe80::20c:29ff:feab:6121 prefixlen 64 scopeid 0x20 ether 00:0c:29:ab:61:21 txqueuelen 1000 (Ethernet) RX packets 1637 bytes 198255 (193.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1291 bytes 236145 (230.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 6 bytes 560 (560.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 560 (560.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
测试目标的连通性
[root@localhost ~]# ping 192.168.63.133PING 192.168.63.133 (192.168.63.133) 56(84) bytes of data.64 bytes from 192.168.63.133: icmp_seq=1 ttl=64 time=0.033 ms64 bytes from 192.168.63.133: icmp_seq=2 ttl=64 time=0.045 ms64 bytes from 192.168.63.133: icmp_seq=3 ttl=64 time=0.048 ms64 bytes from 192.168.63.133: icmp_seq=4 ttl=64 time=0.045 ms64 bytes from 192.168.63.133: icmp_seq=5 ttl=64 time=0.044 ms64 bytes from 192.168.63.133: icmp_seq=6 ttl=64 time=0.044 ms64 bytes from 192.168.63.133: icmp_seq=7 ttl=64 time=0.046 ms64 bytes from 192.168.63.133: icmp_seq=8 ttl=64 time=0.056 ms64 bytes from 192.168.63.133: icmp_seq=9 ttl=64 time=0.043 ms64 bytes from 192.168.63.133: icmp_seq=10 ttl=64 time=0.083 ms64 bytes from 192.168.63.133: icmp_seq=11 ttl=64 time=0.049 ms64 bytes from 192.168.63.133: icmp_seq=12 ttl=64 time=0.044 ms64 bytes from 192.168.63.133: icmp_seq=13 ttl=64 time=0.044 ms64 bytes from 192.168.63.133: icmp_seq=14 ttl=64 time=0.044 ms^C--- 192.168.63.133 ping statistics ---14 packets transmitted, 14 received, 0% packet loss, time 13006msrtt min/avg/max/mdev = 0.033/0.047/0.083/0.013 ms
重启与关机
重启命令
reboot关键命令 halt