N62059第六周作業(yè)

一患膛、編寫(xiě)腳本實(shí)現(xiàn)登陸遠(yuǎn)程主機(jī)。(使用expect和shell腳本)
expect腳本:

輸出結(jié)果:
[root@centOS8 ~]# ./ssh.exp
spawn ssh root@10.0.0.152
The authenticity of host '10.0.0.152 (10.0.0.152)' can't be established.
ECDSA key fingerprint is SHA256:Zd8MyVScskK4y8zOBX637dbImDPUw4U0I/GdOexcM3E.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.0.152' (ECDSA) to the list of known hosts.
root@10.0.0.152's password:
Last login: Wed Dec 15 17:22:09 2021 from 10.0.0.1
ABRT has detected 1 problem(s). For more info run: abrt-cli list --since 1639560129

shell腳本:
[root@centOS8 ~]# vim /data/remote-login.sh
ip=10.0.0.152
user=root
password=+-*/..931215
expect <<EOF
set timeout 10
spawn ssh user@ip
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$password\n" }
}
expect eof
EOF
輸出結(jié)果:
[root@centOS8 ~]# bash /data/remote-login.sh
spawn ssh root@10.0.0.152
root@10.0.0.152's password:
Last login: Thu Dec 23 22:51:29 2021 from 10.0.0.8
[root@magedu ~]#

二、生成10個(gè)隨機(jī)數(shù)保存于數(shù)組中逼裆,并找出其最大值和最小值
代碼:
[root@centOS8 ~]# vim nums.sh

!/bin/bash

declare -i min max
declare -a nums
for ((i=0;i<10;i++));do
nums[i]=RANDOM
[ i -eq 0 ] && min={nums[0]} && max={nums[0]}&& continue [{nums[i]} -gtmax ] && max={nums[i]} && continue
[ {nums[i]} -lt min ] && min={nums[i]} done echo "All numbers are{nums[*]}"
echo Max is max echo Min ismin
輸出結(jié)果:
[root@centOS8 ~]# bash /data/nums.sh
All numbers are 18645 10810 20528 4615 6533 4419 19680 18242 25416 15840
Max is 25416
Min is 4419

三诗力、輸入若干個(gè)數(shù)值存入數(shù)組中烙心,采用冒泡算法進(jìn)行升序或降序排序
[root@centOS8 data]# vim bobbing-nums.s

!/bin/bash

read -p "請(qǐng)輸入數(shù)值個(gè)數(shù):“ COUNT
declare -a nums
for ((i=0;i<COUNT;i++));do num[i]=RANDOM done echo "The ininial array:" echo{num[@]}
declare -i n=COUNT for (( i=0; i<n-1; i++ ));do for (( j=0; j<n+1-i; j++ ));do let x=j+1
if (( {num[j]} < {num[x] ));then
tmp={num[x]}
num[x]={num[j]} num[j]=tmp fi done done echo "After sort:" echo{num[*]}
echo "the max integer is num,the min integer is{num[$((n-1))]}"
輸出結(jié)果:
[root@centOS8 ~]# bash /data/bobbing-nums.sh
請(qǐng)輸入數(shù)值個(gè)數(shù):1215
The initial array:
23208 31895 18076 12705 28115 26736 14523 12778 4635 22544 6934 29360 16169 23424 15840 30375 481 5412 28974 3481 22075 20153 23079 19662 7115 13738 12562 8367 30209 24541 14747 31438 2062 23130 124 26413 25660 9446 7332 3941 21403 28764 25281 6696 14621 9983 14864 10881 7155 30780 13589 30779 1350 22707 1442 32485 10679 26905 8609 1280 28825 20470 12895 1199 2139 6105 25203 10879 12270 30314 19574 4342 29644 8713 17614 25063 12213 18771 9117 23503 13368 587 14799 29972 15969 31419 19382 22934 19758 10409 11612 17807 31310 17710 4346 18388 190 29374 30162 765 21971 19178 2924 10083 29258 5842 29309 7333 24109 682 10054 5480 10004 24422 24159 26291 3783 29017 22614 19244 26361 15446 2713 30022 247 12400 13963 1641 351 14170 14383 20060 22140 4442 23164 15309 26424 20790 20317 13558 19074 27226 27631 15591 5190 20931 30522 17885 23996 12411 13848 3916 266 1169 29535 5575 27433 5631 16364 24636 21190 25689 25872 8313 13295 11524 15105 24798 25535 18336 30399 20220 10986 14651 28790 6768 22274 28158 28330 3043 15225 14748 20351 20810 31519 29292 25117 5254 10852 18126 14148 30904 22099 659 19531 29045 5622 2839 26239 22867 2625 20908 16242 7856 1913 25181 28222 26310 868 24138 27000 2018 19238 23638 24189 14201 6571 24497 1129 25038 14458 11245 12530 13026 25081 27824 28425 4500 14170 18361 864 20493 23475 32515 31526 18432 6027 28373 12123 15281 578 25483 24850 14919 11408 26238 31459 9040 7719 15238 11070 7006 31673 21042 29141 12995 24995 15775 20327 17805 32767 31470 17145 16643 30180 31143 6431 24615 22709 32601 30707 7976 16476 7692 23264 19578 14296 4639 23154 10867 826 32050 32439 28844 24695 20452 19813 31695 885 13452 3351 12954 28151 12729 14835 19830 17541 17033 22724 1591 14781 19286 12318 16383 8260 11217 23123 20832 4900 30341 23898 23818 1311 32365 29847 16882 11092 20483 9708 24910 243 10844 9804 3910 23432 2110 21311 2686 5296 22467 31445 31284 6935 15283 2356 3328 19521 24769 29161 18800 9610 15172 18845 339 17012 8974 15643 26758 21388 25556 20485 16265 5218 26029 3870 13949 32041 22206 7100 32739 22764 17062 18035 22240 11333 5870 9278 4323 18499 22998 17863 14474 11854 24203 12663 11291 27849 22656 5548 2188 15922 32107 16840 31279 27765 5363 7055 26674 22244 20435 26393 29508 6805 19941 11943 11901 18024 3553 27013 14666 25103 5678 17167 19337 15772 4309 14819 13812 21382 17951 26447 12729 3965 8011 14684 5744 26915 8011 13696 7493 23542 19886 4359 11795 13386 8593 4086 1755 12829 14141 19144 26628 11481 31687 31933 4713 21838 11699 32230 10544 24591 14902 28062 17638 10413 8228 19492 4906 30844 24243 3310 7258 2677 23761 29884 507 20435 23262 27004 8738 16071 9061 28558 4433 5578 20160 27765 6741 3256 14320 15225 23421 16126 23536 13980 4831 13242 9940 29282 23468 20148 24589 12286 30476 29293 2157 22659 22974 5531 19070 26812 27810 17116 19915 9225 27034 21181 7846 28627 21852 16130 30563 21273 13321 2719 6386 24200 27827 11466 20661 30335 22688 6494 7130 25116 16724 8173 9396 32668 5139 10909 386 18355 32741 28222 20402 25902 28076 29520 23027 13904 31279 23977 15797 22292 335 7848 26719 116 24494 22251 4233 13838 3368 749 16808 8175 10008 18378 15688 28120 13012 20676 6072 28056 26375 20111 11033 18928 21604 7422 11816 30139 8928 21401 7900 7360 17609 9157 5911 16446 22057 29203 32017 5021 24288 3725 30597 31821 18778 22835 19889 20091 17150 31976 8451 32738 5798 12296 31755 24967 2088 16261 31210 15691 11541 7338 6494 13526 6140 18072 17205 31749 20319 13190 17698 32272 28386 5161 19207 2208 32255 4474 3080 16293 13415 31374 23274 5400 3439 16342 12951 12173 2632 8517 25036 24154 13584 19463 15721 27136 31686 14796 12917 27918 32088 28785 26610 2886 22210 7623 18183 18299 9531 32687 30723 15547 19131 29023 26398 3201 4139 8084 26297 14333 4981 13565 9993 3950 14736 17908 15604 26260 8377 31160 15877 29478 27569 21549 3174 13137 22684 17930 6215 2233 26424 15332 20560 29102 31652 2517 20011 13546 19533 29181 19704 167 2337 8755 24991 16691 16964 21231 3002 15352 16424 15984 21720 30076 29114 6511 8916 10905 21762 9876 27076 1305 31692 26945 30485 17388 27498 17400 7205 30212 20911 3895 5800 19733 26405 25766 30742 2618 9139 29444 12065 30080 22182 31162 22580 4707 18602 13655 12055 27761 13869 31900 1903 17077 12391 28854 5433 31155 11571 9600 18176 8410 28368 23363 23024 18573 21115 19954 36 5616 589 20423 12604 3777 26243 29900 10748 9047 23708 12613 30780 32227 6888 10056 2466 10469 2450 10669 14982 24912 63 18828 18228 28648 12531 25240 16897 2091 32680 7947 26267 5055 10362 15576 10976 1499 6739 31098 24571 2725 13142 9766 21599 23425 8311 1959 8917 32482 28148 21836 8927 15627 17571 497 18711 16133 3125 8038 11638 27962 14150 7224 18422 3209 16650 7501 27640 3189 8998 20524 16501 28234 28951 19694 15363 2671 20995 2636 13906 28008 30967 22774 22976 27274 15964 25987 21808 2015 6113 25268 21449 2456 14348 18457 10037 18523 32467 5901 30101 26179 28010 3303 26246 7482 29749 31278 945 2403 25110 21033 13563 2978 30361 29730 2256 11803 3300 10434 823 19388 28181 30509 20796 3429 9783 9691 7065 4194 28309 9939 11970 28285 6907 6465 10626 14198 197 8733 24568 14847 23284 26920 317 31282 14231 19894 10777 4452 742 27973 7552 478 28084 846 20144 16339 23499 14207 14875 28658 13477 5416 8161 15007 25635 25607 19727 24618 9751 124 29355 4984 31935 15272 27663 3952 15228 26666 22480 19518 12171 32334 24505 17812 15450 29950 28337 971 13729 7824 22366 13629 27563 27963 6115 23748 4570 10376 19021 21392 27076 26562 20315 13410 14546 12339 5947 24096 10122 12064 9415 16172 974 3936 9582 1815 19942 4191 26939 26358 24890 204 5391 19400 32620 14874 13257 1342 1417 15533 21440 13348 18484 1977 9336 8206 5571 28346 11771 25594 28870 7497 29999 5172 5580 17770 29259 30243 19118 10309 27431 9525 1784 13613 19800 3900 27251 21020 2092 13345 6288 13382 8132 21762 18268 17431 32100 24622 5338 19289 3694 11990 6068 32099 13467 1912 9528 19133 6150 25374 26904 28475 24264 24837 17844 22675 25152 4642 19944 31466 25777 23581 13490 17410 220 3811 333 12509 17593 5617 20000 14921 20980 13974 29083 16232 1341 6186 10154 13790 14568 18674 10332 25 15712 8773 962 32306 13795 30000 22294 906 669 24631 2032 31313 5056 28909 5132 31334 5395 13091 28129 31767 29512 14347 11586 4780 12697 27410 9183 18485 12437 23308 12829 16675 14440 23083 23952 25325 23894 1269 6802 5377 20276 2927 20416 1780 16317 27727 26709 18000 21900 2071 15607 11018 25853 16013 21468 17903 726 26625 21326 20170 32426 1872 17415 27427 30010 3161 25587 11455 22798 20879 12324 22128 871 1469 5062 813 23218 31514 2620 7315 16749 7130 18356 14331 142 6114 10424 27217 10844 16239 21807 11922 16826 27718 6746 19829 24875 28346 8810 1500 21692 21443 19168 1804 32544 12133 24138 31417 21904 4363 16753 3968 25769 16286 16825 7725 29967 28869 25257 30458 28428 19288 13280 24395 23949 12570 27887 26371 19615 8195 27213 11162 12575 6135 31657 17789 25334 12570 28728 8151 32246 20399 10060 17261 22613 28295
After sort:
32767 32741 32739 32738 32687 32680 32668 32620 32601 32544 32515 32485 32482 32467 32439 32426 32365 32334 32306 32272 32255 32246 32230 32227 32107 32100 32099 32088 32050 32041 32017 31976 31935 31933 31900 31895 31821 31767 31755 31749 31695 31692 31687 31686 31673 31657 31652 31526 31519 31514 31470 31466 31459 31445 31438 31419 31417 31374 31334 31313 31310 31284 31282 31279 31279 31278 31210 31162 31160 31155 31143 31098 30967 30904 30844 30780 30780 30779 30742 30723 30707 30597 30563 30522 30509 30485 30476 30458 30399 30375 30361 30341 30335 30314 30243 30212 30209 30180 30162 30139 30101 30080 30076 30022 30010 30000 29999 29972 29967 29950 29900 29884 29847 29749 29730 29644 29535 29520 29512 29508 29478 29444 29374 29360 29355 29309 29293 29292 29282 29259 29258 29203 29181 29161 29141 29114 29102 29083 29045 29023 29017 28974 28951 28909 28870 28869 28854 28844 28825 28790 28785 28764 28728 28658 28648 28627 28558 28475 28428 28425 28386 28373 28368 28346 28346 28337 28330 28309 28295 28285 28234 28222 28222 28181 28158 28151 28148 28129 28120 28115 28084 28076 28062 28056 28010 28008 27973 27963 27962 27918 27887 27849 27827 27824 27810 27765 27765 27761 27727 27718 27663 27640 27631 27569 27563 27498 27433 27431 27427 27410 27274 27251 27226 27217 27213 27136 27076 27076 27034 27013 27004 27000 26945 26939 26920 26915 26905 26904 26812 26758 26736 26719 26709 26674 26666 26628 26625 26610 26562 26447 26424 26424 26413 26405 26398 26393 26375 26371 26361 26358 26310 26297 26291 26267 26260 26246 26243 26239 26238 26179 26029 25987 25902 25872 25853 25777 25769 25766 25689 25660 25635 25607 25594 25587 25556 25535 25483 25374 25334 25325 25281 25268 25257 25240 25203 25181 25152 25117 25116 25110 25103 25081 25063 25038 25036 24995 24991 24967 24912 24910 24890 24875 24850 24837 24798 24769 24695 24636 24631 24622 24618 24615 24591 24589 24571 24568 24541 24505 24497 24494 24422 24395 24288 24264 24243 24203 24200 24189 24159 24154 24138 24138 24109 24096 23996 23977 23952 23949 23898 23894 23818 23761 23748 23708 23638 23581 23542 23536 23503 23499 23475 23468 23432 23425 23424 23421 23363 23308 23284 23274 23264 23262 23218 23208 23164 23154 23130 23123 23083 23079 23027 23024 22998 22976 22974 22934 22867 22835 22798 22774 22764 22724 22709 22707 22688 22684 22675 22659 22656 22614 22613 22580 22544 22480 22467 22366 22294 22292 22274 22251 22244 22240 22210 22206 22182 22140 22128 22099 22075 22057 21971 21904 21900 21852 21838 21836 21808 21807 21762 21762 21720 21692 21604 21599 21549 21468 21449 21443 21440 21403 21401 21392 21388 21382 21326 21311 21273 21231 21190 21181 21115 21042 21033 21020 20995 20980 20931 20911 20908 20879 20832 20810 20796 20790 20676 20661 20560 20524 20493 20485 20483 20470 20452 20435 20435 20423 20416 20402 20399 20351 20327 20319 20317 20315 20276 20220 20170 20160 20153 20148 20144 20111 20091 20060 20011 20000 19954 19944 19942 19941 19915 19894 19889 19886 19830 19829 19813 19800 19758 19733 19727 19704 19694 19662 19615 19578 19574 19533 19531 19521 19518 19492 19463 19400 19388 19382 19337 19289 19288 19286 19244 19238 19207 19178 19168 19144 19133 19131 19118 19074 19070 19021 18928 18845 18828 18800 18778 18771 18711 18674 18602 18573 18523 18499 18485 18484 18457 18432 18422 18388 18378 18361 18356 18355 18336 18299 18268 18228 18183 18176 18126 18076 18072 18035 18024 18000 17951 17930 17908 17903 17885 17863 17844 17812 17807 17805 17789 17770 17710 17698 17638 17614 17609 17593 17571 17541 17431 17415 17410 17400 17388 17261 17205 17167 17150 17145 17116 17077 17062 17033 17012 16964 16897 16882 16840 16826 16825 16808 16753 16749 16724 16691 16675 16650 16643 16501 16476 16446 16424 16383 16364 16342 16339 16317 16293 16286 16265 16261 16242 16239 16232 16172 16169 16133 16130 16126 16071 16013 15984 15969 15964 15922 15877 15840 15797 15775 15772 15721 15712 15691 15688 15643 15627 15607 15604 15591 15576 15547 15533 15450 15446 15363 15352 15332 15309 15283 15281 15272 15238 15228 15225 15225 15172 15105 15007 14982 14921 14919 14902 14875 14874 14864 14847 14835 14819 14799 14796 14781 14748 14747 14736 14684 14666 14651 14621 14568 14546 14523 14474 14458 14440 14383 14348 14347 14333 14331 14320 14296 14231 14207 14201 14198 14170 14170 14150 14148 14141 13980 13974 13963 13949 13906 13904 13869 13848 13838 13812 13795 13790 13738 13729 13696 13655 13629 13613 13589 13584 13565 13563 13558 13546 13526 13490 13477 13467 13452 13415 13410 13386 13382 13368 13348 13345 13321 13295 13280 13257 13242 13190 13142 13137 13091 13026 13012 12995 12954 12951 12917 12895 12829 12829 12778 12729 12729 12705 12697 12663 12613 12604 12575 12570 12570 12562 12531 12530 12509 12437 12411 12400 12391 12339 12324 12318 12296 12286 12270 12213 12173 12171 12133 12123 12065 12064 12055 11990 11970 11943 11922 11901 11854 11816 11803 11795 11771 11699 11638 11612 11586 11571 11541 11524 11481 11466 11455 11408 11333 11291 11245 11217 11162 11092 11070 11033 11018 10986 10976 10909 10905 10881 10879 10867 10852 10844 10844 10777 10748 10679 10669 10626 10544 10469 10434 10424 10413 10409 10376 10362 10332 10309 10154 10122 10083 10060 10056 10054 10037 10008 10004 9993 9983 9940 9939 9876 9804 9783 9766 9751 9708 9691 9610 9600 9582 9531 9528 9525 9446 9415 9396 9336 9278 9225 9183 9157 9139 9117 9061 9047 9040 8998 8974 8928 8927 8917 8916 8810 8773 8755 8738 8733 8713 8609 8593 8517 8451 8410 8377 8367 8313 8311 8260 8228 8206 8195 8175 8173 8161 8151 8132 8084 8038 8011 8011 7976 7947 7900 7856 7848 7846 7824 7725 7719 7692 7623 7552 7501 7497 7493 7482 7422 7360 7338 7333 7332 7315 7258 7224 7205 7155 7130 7130 7115 7100 7065 7055 7006 6935 6934 6907 6888 6805 6802 6768 6746 6741 6739 6696 6571 6511 6494 6494 6465 6431 6386 6288 6215 6186 6150 6140 6135 6115 6114 6113 6105 6072 6068 6027 5947 5911 5901 5870 5842 5800 5798 5744 5678 5631 5622 5617 5616 5580 5578 5575 5571 5548 5531 5480 5433 5416 5412 5400 5395 5391 5377 5363 5338 5296 5254 5218 5190 5172 5161 5139 5132 5062 5056 5055 5021 4984 4981 4906 4900 4831 4780 4713 4707 4642 4639 4635 4570 4500 4474 4452 4442 4433 4363 4359 4346 4342 4323 4309 4233 4194 4191 4139 4086 3968 3965 3952 3950 3941 3936 3916 3910 3900 3895 3870 3811 3783 3777 3725 3694 3553 3481 3439 3429 3368 3351 3328 3310 3303 3300 3256 3209 3201 3189 3174 3161 3125 3080 3043 3002 2978 2927 2924 2886 2839 2725 2719 2713 2686 2677 2671 2636 2632 2625 2620 2618 2517 2466 2456 2450 2403 2356 2337 2256 2233 2208 2188 2157 2139 2110 2092 2091 2088 2071 2062 2032 2018 2015 1977 1959 1913 1912 1903 1872 1815 1804 1784 1780 1755 1641 1591 1500 1499 1469 1442 1417 1350 1342 1341 1311 1305 1280 1269 1199 1169 1129 974 971 962 945 906 885 871 868 864 846 826 823 813 765 749 742 726 682 669 659 589 587 578 507 497 481 478 386 351 339 335 333 317 266 247 243 220 204 197 190 167 142 124 124 116 63 36 25
the max integer is 32767,the min integer is 25

四稿械、總結(jié)查看系統(tǒng)負(fù)載的幾種命令选泻,總結(jié)top命令的指標(biāo)大概什么含義(不要全部寫(xiě)出來(lái))
系統(tǒng)負(fù)載命令:
uptime:查看系統(tǒng)平均負(fù)載
mpstat:百分比顯示CPU利用率的各項(xiàng)指標(biāo)
top和htop:查看進(jìn)程的實(shí)時(shí)狀態(tài)
free:查看內(nèi)存空間的使用狀態(tài)
pmap:查看進(jìn)程對(duì)應(yīng)的內(nèi)存映射,可以看到進(jìn)程依賴(lài)的子模塊占用的內(nèi)存數(shù)量溜哮,可以以此判斷OOM
vmstat:查看虛擬內(nèi)存的信息滔金,可以以用戶(hù)定義的間隔不斷刷新?tīng)顟B(tài)色解,能夠看到內(nèi)存與SWAP、磁盤(pán)之間的IO情況科阎;
iostat:能夠看到更豐富的IO性能狀態(tài)述吸,可以自定義刷新間隔判斷哪塊硬盤(pán)的IO比較繁忙;-x參數(shù)可以看到磁盤(pán)基于扇區(qū)的IO锣笨,隊(duì)列長(zhǎng)度蝌矛,處理時(shí)間等
iotop:以top方式監(jiān)控磁盤(pán)的I/O,實(shí)時(shí)監(jiān)控错英,而且可以只顯示正在執(zhí)行讀寫(xiě)的進(jìn)程入撒,提供很多非交互式參數(shù);
iftop:顯示網(wǎng)絡(luò)帶寬的使用情況椭岩,查看訪問(wèn)當(dāng)前主機(jī)的流量的實(shí)時(shí)信息茅逮,實(shí)時(shí)連接等;
nload:只能以接口為單位查看實(shí)時(shí)吞吐量判哥,看不到連接信息献雅,只有速率信息;
top命令指標(biāo)含義:


image.png

第一行:
當(dāng)前時(shí)間塌计、系統(tǒng)啟動(dòng)時(shí)間挺身、當(dāng)前系統(tǒng)登錄用戶(hù)數(shù)目、平均負(fù)載(1分鐘,10分鐘,15分鐘)锌仅。
平均負(fù)載(load average),一般對(duì)于單個(gè)cpu來(lái)說(shuō)章钾,負(fù)載在0~1.00之間是正常的,超過(guò)1.00須引起注意热芹。在多核cpu中贱傀,系統(tǒng)平均負(fù)載不應(yīng)該高于cpu核心的總數(shù)。
第二行:
進(jìn)程總數(shù)剿吻、運(yùn)行進(jìn)程數(shù)窍箍、休眠進(jìn)程數(shù)、終止進(jìn)程數(shù)、僵死進(jìn)程數(shù)椰棘。
第三行:
%us用戶(hù)空間占用cpu百分比纺棺;
%sy內(nèi)核空間占用cpu百分比;
%ni用戶(hù)進(jìn)程空間內(nèi)改變過(guò)優(yōu)先級(jí)的進(jìn)程占用cpu百分比邪狞;
%id空閑cpu百分比祷蝌,反映一個(gè)系統(tǒng)cpu的閑忙程度。越大越空閑帆卓;
%wa等待輸入輸出(I/O)的cpu百分比巨朦;
%hi指的是cpu處理硬件中斷的時(shí)間;
%si值的是cpu處理軟件中斷的時(shí)間剑令;
%st用于有虛擬cpu的情況糊啡,用來(lái)指示被虛擬機(jī)偷掉的cpu時(shí)間。
第四行:
total總的物理內(nèi)存吁津;
used使用物理內(nèi)存大信镄睢;
free空閑物理內(nèi)存碍脏;
buffers用于內(nèi)核緩存的內(nèi)存大小
第五行:
total總的交換空間大兴笠馈;
used已經(jīng)使用交換空間大械湮病役拴;
free空間交換空間大小钾埂;
cached緩沖的交換空間大小
buffers于cached區(qū)別:buffers指的是塊設(shè)備的讀寫(xiě)緩沖區(qū)河闰,cached指的是文件系統(tǒng)本身的頁(yè)面緩存。他們都是Linux系統(tǒng)底層的機(jī)制勃教,為了加速對(duì)磁盤(pán)的訪問(wèn)淤击。
第六行:
PID 進(jìn)程號(hào)
USER 運(yùn)行用戶(hù)
PR
優(yōu)先級(jí),PR(Priority)所代表的值有什么含義故源?它其實(shí)就是進(jìn)程調(diào)度器分配給進(jìn)程的時(shí)間片長(zhǎng)度污抬,單位是時(shí)鐘個(gè)數(shù),那么一個(gè)時(shí)鐘需要多長(zhǎng)時(shí)間呢绳军?這
跟CPU的主頻以及操作系統(tǒng)平臺(tái)有關(guān)印机,比如linux上一般為10ms,那么PR值為15則表示這個(gè)進(jìn)程的時(shí)間片為150ms门驾。
NI 任務(wù)nice值
VIRT 進(jìn)程使用的虛擬內(nèi)存總量射赛,單位kb。VIRT=SWAP+RES
RES 物理內(nèi)存用量
SHR 共享內(nèi)存用量
S 該進(jìn)程的狀態(tài)奶是。其中S代表休眠狀態(tài)楣责;D代表不可中斷的休眠狀態(tài)竣灌;R代表運(yùn)行狀態(tài);Z代表僵死狀態(tài)秆麸;T代表停止或跟蹤狀態(tài)
%CPU 該進(jìn)程自最近一次刷新以來(lái)所占用的CPU時(shí)間和總時(shí)間的百分比
%MEM 該進(jìn)程占用的物理內(nèi)存占總內(nèi)存的百分比
TIME+ 累計(jì)cpu占用時(shí)間
COMMAND 該進(jìn)程的命令名稱(chēng)初嘹,如果一行顯示不下,則會(huì)進(jìn)行截取沮趣。內(nèi)存中的進(jìn)程會(huì)有一個(gè)完整的命令行屯烦。

五、編寫(xiě)腳本房铭,使用for和while分別實(shí)現(xiàn)192.168.0.0/24網(wǎng)段內(nèi)驻龟,地址是否能夠ping通,若ping通則輸出"success!"缸匪,若ping不通則輸出"fail!"
用“for”實(shí)現(xiàn)的腳本:

!/bin/bash

NetId=192.168.0.
declare -i HostId=1
while [ HostId -le 254 ];do { /bin/ping -c 1 -W 1NetIdHostId > /dev/null if [? -eq 0 ];then
echo "NetIdHostId lived,Ping Test Successed"
else
echo "NetIdHostId not lived,Ping Test Failed"
fi
} &
let HostId++
done
wait
輸出結(jié)果:
[root@centOS8 data]# ./test-ping-for.sh
192.168.0.1 not lived,Ping Test Failed
192.168.0.4 not lived,Ping Test Failed
192.168.0.6 not lived,Ping Test Failed
192.168.0.8 not lived,Ping Test Failed
192.168.0.10 not lived,Ping Test Failed
192.168.0.12 not lived,Ping Test Failed
192.168.0.16 not lived,Ping Test Failed
192.168.0.21 not lived,Ping Test Failed
192.168.0.27 not lived,Ping Test Failed
192.168.0.25 not lived,Ping Test Failed
192.168.0.29 not lived,Ping Test Failed
192.168.0.31 not lived,Ping Test Failed
192.168.0.56 not lived,Ping Test Failed
192.168.0.33 not lived,Ping Test Failed
192.168.0.36 not lived,Ping Test Failed
192.168.0.17 not lived,Ping Test Failed
192.168.0.38 not lived,Ping Test Failed
192.168.0.40 not lived,Ping Test Failed
192.168.0.54 not lived,Ping Test Failed
192.168.0.43 not lived,Ping Test Failed
192.168.0.45 not lived,Ping Test Failed
192.168.0.19 not lived,Ping Test Failed
192.168.0.47 not lived,Ping Test Failed
192.168.0.34 not lived,Ping Test Failed
192.168.0.51 not lived,Ping Test Failed
192.168.0.55 not lived,Ping Test Failed
192.168.0.53 not lived,Ping Test Failed
192.168.0.49 not lived,Ping Test Failed
192.168.0.7 not lived,Ping Test Failed
192.168.0.13 not lived,Ping Test Failed
192.168.0.57 not lived,Ping Test Failed
192.168.0.61 not lived,Ping Test Failed
192.168.0.46 not lived,Ping Test Failed
192.168.0.63 not lived,Ping Test Failed
192.168.0.26 not lived,Ping Test Failed
192.168.0.65 not lived,Ping Test Failed
192.168.0.50 not lived,Ping Test Failed
192.168.0.68 not lived,Ping Test Failed
192.168.0.9 not lived,Ping Test Failed
192.168.0.71 not lived,Ping Test Failed
192.168.0.59 not lived,Ping Test Failed
192.168.0.52 not lived,Ping Test Failed
192.168.0.48 not lived,Ping Test Failed
192.168.0.20 not lived,Ping Test Failed
192.168.0.73 not lived,Ping Test Failed
192.168.0.75 not lived,Ping Test Failed
192.168.0.23 not lived,Ping Test Failed
192.168.0.24 not lived,Ping Test Failed
192.168.0.77 not lived,Ping Test Failed
192.168.0.35 not lived,Ping Test Failed
192.168.0.22 not lived,Ping Test Failed
192.168.0.3 not lived,Ping Test Failed
192.168.0.39 not lived,Ping Test Failed
192.168.0.32 not lived,Ping Test Failed
192.168.0.37 not lived,Ping Test Failed
192.168.0.79 not lived,Ping Test Failed
192.168.0.41 not lived,Ping Test Failed
192.168.0.11 not lived,Ping Test Failed
192.168.0.28 not lived,Ping Test Failed
192.168.0.42 not lived,Ping Test Failed
192.168.0.14 not lived,Ping Test Failed
192.168.0.15 not lived,Ping Test Failed
192.168.0.84 not lived,Ping Test Failed
192.168.0.5 not lived,Ping Test Failed
192.168.0.85 not lived,Ping Test Failed
192.168.0.108 not lived,Ping Test Failed
192.168.0.30 not lived,Ping Test Failed
192.168.0.44 not lived,Ping Test Failed
192.168.0.122 not lived,Ping Test Failed
192.168.0.131 not lived,Ping Test Failed
192.168.0.18 not lived,Ping Test Failed
192.168.0.67 not lived,Ping Test Failed
192.168.0.104 not lived,Ping Test Failed
192.168.0.2 not lived,Ping Test Failed
192.168.0.113 not lived,Ping Test Failed
192.168.0.127 not lived,Ping Test Failed
192.168.0.114 not lived,Ping Test Failed
192.168.0.95 not lived,Ping Test Failed
192.168.0.96 not lived,Ping Test Failed
192.168.0.93 not lived,Ping Test Failed
192.168.0.112 not lived,Ping Test Failed
192.168.0.89 not lived,Ping Test Failed
192.168.0.91 not lived,Ping Test Failed
192.168.0.110 not lived,Ping Test Failed
192.168.0.97 not lived,Ping Test Failed
192.168.0.86 not lived,Ping Test Failed
192.168.0.90 not lived,Ping Test Failed
192.168.0.64 not lived,Ping Test Failed
192.168.0.70 not lived,Ping Test Failed
192.168.0.118 not lived,Ping Test Failed
192.168.0.92 not lived,Ping Test Failed
192.168.0.102 not lived,Ping Test Failed
192.168.0.58 not lived,Ping Test Failed
192.168.0.111 not lived,Ping Test Failed
192.168.0.116 not lived,Ping Test Failed
192.168.0.132 not lived,Ping Test Failed
192.168.0.107 not lived,Ping Test Failed
192.168.0.105 not lived,Ping Test Failed
192.168.0.101 not lived,Ping Test Failed
192.168.0.106 not lived,Ping Test Failed
192.168.0.136 not lived,Ping Test Failed
192.168.0.100 not lived,Ping Test Failed
192.168.0.117 not lived,Ping Test Failed
192.168.0.98 not lived,Ping Test Failed
192.168.0.134 not lived,Ping Test Failed
192.168.0.69 not lived,Ping Test Failed
192.168.0.83 not lived,Ping Test Failed
192.168.0.88 not lived,Ping Test Failed
192.168.0.66 not lived,Ping Test Failed
192.168.0.72 not lived,Ping Test Failed
192.168.0.109 not lived,Ping Test Failed
192.168.0.82 not lived,Ping Test Failed
192.168.0.74 not lived,Ping Test Failed
192.168.0.81 not lived,Ping Test Failed
192.168.0.124 not lived,Ping Test Failed
192.168.0.133 not lived,Ping Test Failed
192.168.0.94 not lived,Ping Test Failed
192.168.0.103 not lived,Ping Test Failed
192.168.0.62 not lived,Ping Test Failed
192.168.0.128 not lived,Ping Test Failed
192.168.0.121 not lived,Ping Test Failed
192.168.0.115 not lived,Ping Test Failed
192.168.0.99 not lived,Ping Test Failed
192.168.0.139 not lived,Ping Test Failed
192.168.0.120 not lived,Ping Test Failed
192.168.0.130 not lived,Ping Test Failed
192.168.0.119 not lived,Ping Test Failed
192.168.0.138 not lived,Ping Test Failed
192.168.0.76 not lived,Ping Test Failed
192.168.0.137 not lived,Ping Test Failed
192.168.0.87 not lived,Ping Test Failed
192.168.0.78 not lived,Ping Test Failed
192.168.0.125 not lived,Ping Test Failed
192.168.0.80 not lived,Ping Test Failed
192.168.0.60 not lived,Ping Test Failed
192.168.0.126 not lived,Ping Test Failed
192.168.0.123 not lived,Ping Test Failed
192.168.0.129 not lived,Ping Test Failed
192.168.0.135 not lived,Ping Test Failed
192.168.0.141 not lived,Ping Test Failed
192.168.0.142 not lived,Ping Test Failed
192.168.0.144 not lived,Ping Test Failed
192.168.0.145 not lived,Ping Test Failed
192.168.0.189 not lived,Ping Test Failed
192.168.0.213 not lived,Ping Test Failed
192.168.0.167 not lived,Ping Test Failed
192.168.0.178 not lived,Ping Test Failed
192.168.0.180 not lived,Ping Test Failed
192.168.0.196 not lived,Ping Test Failed
192.168.0.175 not lived,Ping Test Failed
192.168.0.157 not lived,Ping Test Failed
192.168.0.183 not lived,Ping Test Failed
192.168.0.155 not lived,Ping Test Failed
192.168.0.184 not lived,Ping Test Failed
192.168.0.207 not lived,Ping Test Failed
192.168.0.166 not lived,Ping Test Failed
192.168.0.162 not lived,Ping Test Failed
192.168.0.209 not lived,Ping Test Failed
192.168.0.158 not lived,Ping Test Failed
192.168.0.164 not lived,Ping Test Failed
192.168.0.193 not lived,Ping Test Failed
192.168.0.200 not lived,Ping Test Failed
192.168.0.156 not lived,Ping Test Failed
192.168.0.202 not lived,Ping Test Failed
192.168.0.146 not lived,Ping Test Failed
192.168.0.206 not lived,Ping Test Failed
192.168.0.147 not lived,Ping Test Failed
192.168.0.182 not lived,Ping Test Failed
192.168.0.154 not lived,Ping Test Failed
192.168.0.195 not lived,Ping Test Failed
192.168.0.140 not lived,Ping Test Failed
192.168.0.143 not lived,Ping Test Failed
192.168.0.214 not lived,Ping Test Failed
192.168.0.153 not lived,Ping Test Failed
192.168.0.152 not lived,Ping Test Failed
192.168.0.203 not lived,Ping Test Failed
192.168.0.150 not lived,Ping Test Failed
192.168.0.159 not lived,Ping Test Failed
192.168.0.148 not lived,Ping Test Failed
192.168.0.165 not lived,Ping Test Failed
192.168.0.149 not lived,Ping Test Failed
192.168.0.173 not lived,Ping Test Failed
192.168.0.161 not lived,Ping Test Failed
192.168.0.151 not lived,Ping Test Failed
192.168.0.163 not lived,Ping Test Failed
192.168.0.170 not lived,Ping Test Failed
192.168.0.160 not lived,Ping Test Failed
192.168.0.176 not lived,Ping Test Failed
192.168.0.177 not lived,Ping Test Failed
192.168.0.169 not lived,Ping Test Failed
192.168.0.174 not lived,Ping Test Failed
192.168.0.179 not lived,Ping Test Failed
192.168.0.197 not lived,Ping Test Failed
192.168.0.211 not lived,Ping Test Failed
192.168.0.188 not lived,Ping Test Failed
192.168.0.171 not lived,Ping Test Failed
192.168.0.187 not lived,Ping Test Failed
192.168.0.190 not lived,Ping Test Failed
192.168.0.243 not lived,Ping Test Failed
192.168.0.208 not lived,Ping Test Failed
192.168.0.250 not lived,Ping Test Failed
192.168.0.201 not lived,Ping Test Failed
192.168.0.245 not lived,Ping Test Failed
192.168.0.204 not lived,Ping Test Failed
192.168.0.254 not lived,Ping Test Failed
192.168.0.205 not lived,Ping Test Failed
192.168.0.215 not lived,Ping Test Failed
192.168.0.181 not lived,Ping Test Failed
192.168.0.248 not lived,Ping Test Failed
192.168.0.185 not lived,Ping Test Failed
192.168.0.186 not lived,Ping Test Failed
192.168.0.223 not lived,Ping Test Failed
192.168.0.191 not lived,Ping Test Failed
192.168.0.216 not lived,Ping Test Failed
192.168.0.232 not lived,Ping Test Failed
192.168.0.192 not lived,Ping Test Failed
192.168.0.233 not lived,Ping Test Failed
192.168.0.194 not lived,Ping Test Failed
192.168.0.198 not lived,Ping Test Failed
192.168.0.241 not lived,Ping Test Failed
192.168.0.199 not lived,Ping Test Failed
192.168.0.217 not lived,Ping Test Failed
192.168.0.210 not lived,Ping Test Failed
192.168.0.219 not lived,Ping Test Failed
192.168.0.212 not lived,Ping Test Failed
192.168.0.225 not lived,Ping Test Failed
192.168.0.168 not lived,Ping Test Failed
192.168.0.172 not lived,Ping Test Failed
192.168.0.229 not lived,Ping Test Failed
192.168.0.242 not lived,Ping Test Failed
192.168.0.249 not lived,Ping Test Failed
192.168.0.230 not lived,Ping Test Failed
192.168.0.244 not lived,Ping Test Failed
192.168.0.222 not lived,Ping Test Failed
192.168.0.237 not lived,Ping Test Failed
192.168.0.231 not lived,Ping Test Failed
192.168.0.221 not lived,Ping Test Failed
192.168.0.247 not lived,Ping Test Failed
192.168.0.227 not lived,Ping Test Failed
192.168.0.226 not lived,Ping Test Failed
192.168.0.228 not lived,Ping Test Failed
192.168.0.236 not lived,Ping Test Failed
192.168.0.239 not lived,Ping Test Failed
192.168.0.234 not lived,Ping Test Failed
192.168.0.246 not lived,Ping Test Failed
192.168.0.220 not lived,Ping Test Failed
192.168.0.235 not lived,Ping Test Failed
192.168.0.238 not lived,Ping Test Failed
192.168.0.251 not lived,Ping Test Failed
192.168.0.253 not lived,Ping Test Failed
192.168.0.218 not lived,Ping Test Failed
192.168.0.224 not lived,Ping Test Failed
192.168.0.252 not lived,Ping Test Failed
192.168.0.240 not lived,Ping Test Failed
用“while”實(shí)現(xiàn)的腳本:
[root@centOS8 data]# vim test-ping-while.sh

!/bin/bash

NetId=192.168.0.
declare -i HostId=1
while [ HostId -le 254 ];do { /bin/ping -c 1 -w 1NetIdHostId > /dev/null if [? -eq 0 ];then
echo "NetIdHostId lived,Ping Test Successed"
else
echo "NetIdHostId not lived.Ping Test Failed"
fi
} &
let HostId++
done
wait
輸出結(jié)果:
[root@centOS8 data]# ./test-ping-while.sh
192.168.0.1 not lived.Ping Test Failed
192.168.0.4 not lived.Ping Test Failed
192.168.0.6 not lived.Ping Test Failed
192.168.0.8 not lived.Ping Test Failed
192.168.0.10 not lived.Ping Test Failed
192.168.0.13 not lived.Ping Test Failed
192.168.0.15 not lived.Ping Test Failed
192.168.0.17 not lived.Ping Test Failed
192.168.0.21 not lived.Ping Test Failed
192.168.0.29 not lived.Ping Test Failed
192.168.0.34 not lived.Ping Test Failed
192.168.0.40 not lived.Ping Test Failed
192.168.0.38 not lived.Ping Test Failed
192.168.0.31 not lived.Ping Test Failed
192.168.0.2 not lived.Ping Test Failed
192.168.0.36 not lived.Ping Test Failed
192.168.0.42 not lived.Ping Test Failed
192.168.0.50 not lived.Ping Test Failed
192.168.0.44 not lived.Ping Test Failed
192.168.0.46 not lived.Ping Test Failed
192.168.0.48 not lived.Ping Test Failed
192.168.0.52 not lived.Ping Test Failed
192.168.0.58 not lived.Ping Test Failed
192.168.0.56 not lived.Ping Test Failed
192.168.0.60 not lived.Ping Test Failed
192.168.0.62 not lived.Ping Test Failed
192.168.0.64 not lived.Ping Test Failed
192.168.0.66 not lived.Ping Test Failed
192.168.0.69 not lived.Ping Test Failed
192.168.0.3 not lived.Ping Test Failed
192.168.0.70 not lived.Ping Test Failed
192.168.0.7 not lived.Ping Test Failed
192.168.0.73 not lived.Ping Test Failed
192.168.0.75 not lived.Ping Test Failed
192.168.0.9 not lived.Ping Test Failed
192.168.0.11 not lived.Ping Test Failed
192.168.0.5 not lived.Ping Test Failed
192.168.0.77 not lived.Ping Test Failed
192.168.0.14 not lived.Ping Test Failed
192.168.0.78 not lived.Ping Test Failed
192.168.0.12 not lived.Ping Test Failed
192.168.0.16 not lived.Ping Test Failed
192.168.0.80 not lived.Ping Test Failed
192.168.0.18 not lived.Ping Test Failed
192.168.0.19 not lived.Ping Test Failed
192.168.0.82 not lived.Ping Test Failed
192.168.0.22 not lived.Ping Test Failed
192.168.0.20 not lived.Ping Test Failed
192.168.0.88 not lived.Ping Test Failed
192.168.0.91 not lived.Ping Test Failed
192.168.0.23 not lived.Ping Test Failed
192.168.0.24 not lived.Ping Test Failed
192.168.0.86 not lived.Ping Test Failed
192.168.0.84 not lived.Ping Test Failed
192.168.0.25 not lived.Ping Test Failed
192.168.0.92 not lived.Ping Test Failed
192.168.0.26 not lived.Ping Test Failed
192.168.0.27 not lived.Ping Test Failed
192.168.0.99 not lived.Ping Test Failed
192.168.0.101 not lived.Ping Test Failed
192.168.0.28 not lived.Ping Test Failed
192.168.0.97 not lived.Ping Test Failed
192.168.0.30 not lived.Ping Test Failed
192.168.0.35 not lived.Ping Test Failed
192.168.0.76 not lived.Ping Test Failed
192.168.0.39 not lived.Ping Test Failed
192.168.0.43 not lived.Ping Test Failed
192.168.0.53 not lived.Ping Test Failed
192.168.0.51 not lived.Ping Test Failed
192.168.0.65 not lived.Ping Test Failed
192.168.0.32 not lived.Ping Test Failed
192.168.0.49 not lived.Ping Test Failed
192.168.0.37 not lived.Ping Test Failed
192.168.0.45 not lived.Ping Test Failed
192.168.0.71 not lived.Ping Test Failed
192.168.0.54 not lived.Ping Test Failed
192.168.0.74 not lived.Ping Test Failed
192.168.0.59 not lived.Ping Test Failed
192.168.0.103 not lived.Ping Test Failed
192.168.0.57 not lived.Ping Test Failed
192.168.0.41 not lived.Ping Test Failed
192.168.0.63 not lived.Ping Test Failed
192.168.0.33 not lived.Ping Test Failed
192.168.0.68 not lived.Ping Test Failed
192.168.0.72 not lived.Ping Test Failed
192.168.0.106 not lived.Ping Test Failed
192.168.0.55 not lived.Ping Test Failed
192.168.0.67 not lived.Ping Test Failed
192.168.0.47 not lived.Ping Test Failed
192.168.0.114 not lived.Ping Test Failed
192.168.0.118 not lived.Ping Test Failed
192.168.0.123 not lived.Ping Test Failed
192.168.0.79 not lived.Ping Test Failed
192.168.0.81 not lived.Ping Test Failed
192.168.0.61 not lived.Ping Test Failed
192.168.0.110 not lived.Ping Test Failed
192.168.0.102 not lived.Ping Test Failed
192.168.0.117 not lived.Ping Test Failed
192.168.0.139 not lived.Ping Test Failed
192.168.0.83 not lived.Ping Test Failed
192.168.0.130 not lived.Ping Test Failed
192.168.0.109 not lived.Ping Test Failed
192.168.0.143 not lived.Ping Test Failed
192.168.0.131 not lived.Ping Test Failed
192.168.0.140 not lived.Ping Test Failed
192.168.0.121 not lived.Ping Test Failed
192.168.0.128 not lived.Ping Test Failed
192.168.0.116 not lived.Ping Test Failed
192.168.0.137 not lived.Ping Test Failed
192.168.0.151 not lived.Ping Test Failed
192.168.0.125 not lived.Ping Test Failed
192.168.0.87 not lived.Ping Test Failed
192.168.0.111 not lived.Ping Test Failed
192.168.0.126 not lived.Ping Test Failed
192.168.0.133 not lived.Ping Test Failed
192.168.0.127 not lived.Ping Test Failed
192.168.0.134 not lived.Ping Test Failed
192.168.0.105 not lived.Ping Test Failed
192.168.0.108 not lived.Ping Test Failed
192.168.0.142 not lived.Ping Test Failed
192.168.0.94 not lived.Ping Test Failed
192.168.0.119 not lived.Ping Test Failed
192.168.0.93 not lived.Ping Test Failed
192.168.0.112 not lived.Ping Test Failed
192.168.0.147 not lived.Ping Test Failed
192.168.0.129 not lived.Ping Test Failed
192.168.0.85 not lived.Ping Test Failed
192.168.0.135 not lived.Ping Test Failed
192.168.0.100 not lived.Ping Test Failed
192.168.0.146 not lived.Ping Test Failed
192.168.0.141 not lived.Ping Test Failed
192.168.0.145 not lived.Ping Test Failed
192.168.0.98 not lived.Ping Test Failed
192.168.0.148 not lived.Ping Test Failed
192.168.0.95 not lived.Ping Test Failed
192.168.0.150 not lived.Ping Test Failed
192.168.0.107 not lived.Ping Test Failed
192.168.0.96 not lived.Ping Test Failed
192.168.0.136 not lived.Ping Test Failed
192.168.0.115 not lived.Ping Test Failed
192.168.0.104 not lived.Ping Test Failed
192.168.0.144 not lived.Ping Test Failed
192.168.0.138 not lived.Ping Test Failed
192.168.0.120 not lived.Ping Test Failed
192.168.0.132 not lived.Ping Test Failed
192.168.0.89 not lived.Ping Test Failed
192.168.0.124 not lived.Ping Test Failed
192.168.0.122 not lived.Ping Test Failed
192.168.0.162 not lived.Ping Test Failed
192.168.0.149 not lived.Ping Test Failed
192.168.0.152 not lived.Ping Test Failed
192.168.0.163 not lived.Ping Test Failed
192.168.0.195 not lived.Ping Test Failed
192.168.0.157 not lived.Ping Test Failed
192.168.0.222 not lived.Ping Test Failed
192.168.0.200 not lived.Ping Test Failed
192.168.0.190 not lived.Ping Test Failed
192.168.0.196 not lived.Ping Test Failed
192.168.0.206 not lived.Ping Test Failed
192.168.0.181 not lived.Ping Test Failed
192.168.0.186 not lived.Ping Test Failed
192.168.0.218 not lived.Ping Test Failed
192.168.0.187 not lived.Ping Test Failed
192.168.0.221 not lived.Ping Test Failed
192.168.0.153 not lived.Ping Test Failed
192.168.0.164 not lived.Ping Test Failed
192.168.0.213 not lived.Ping Test Failed
192.168.0.192 not lived.Ping Test Failed
192.168.0.178 not lived.Ping Test Failed
192.168.0.227 not lived.Ping Test Failed
192.168.0.179 not lived.Ping Test Failed
192.168.0.198 not lived.Ping Test Failed
192.168.0.188 not lived.Ping Test Failed
192.168.0.193 not lived.Ping Test Failed
192.168.0.182 not lived.Ping Test Failed
192.168.0.191 not lived.Ping Test Failed
192.168.0.159 not lived.Ping Test Failed
192.168.0.225 not lived.Ping Test Failed
192.168.0.165 not lived.Ping Test Failed
192.168.0.209 not lived.Ping Test Failed
192.168.0.171 not lived.Ping Test Failed
192.168.0.158 not lived.Ping Test Failed
192.168.0.172 not lived.Ping Test Failed
192.168.0.161 not lived.Ping Test Failed
192.168.0.155 not lived.Ping Test Failed
192.168.0.180 not lived.Ping Test Failed
192.168.0.168 not lived.Ping Test Failed
192.168.0.167 not lived.Ping Test Failed
192.168.0.184 not lived.Ping Test Failed
192.168.0.174 not lived.Ping Test Failed
192.168.0.154 not lived.Ping Test Failed
192.168.0.199 not lived.Ping Test Failed
192.168.0.183 not lived.Ping Test Failed
192.168.0.205 not lived.Ping Test Failed
192.168.0.217 not lived.Ping Test Failed
192.168.0.166 not lived.Ping Test Failed
192.168.0.202 not lived.Ping Test Failed
192.168.0.170 not lived.Ping Test Failed
192.168.0.208 not lived.Ping Test Failed
192.168.0.173 not lived.Ping Test Failed
192.168.0.203 not lived.Ping Test Failed
192.168.0.160 not lived.Ping Test Failed
192.168.0.219 not lived.Ping Test Failed
192.168.0.204 not lived.Ping Test Failed
192.168.0.211 not lived.Ping Test Failed
192.168.0.210 not lived.Ping Test Failed
192.168.0.212 not lived.Ping Test Failed
192.168.0.215 not lived.Ping Test Failed
192.168.0.220 not lived.Ping Test Failed
192.168.0.185 not lived.Ping Test Failed
192.168.0.224 not lived.Ping Test Failed
192.168.0.201 not lived.Ping Test Failed
192.168.0.216 not lived.Ping Test Failed
192.168.0.156 not lived.Ping Test Failed
192.168.0.214 not lived.Ping Test Failed
192.168.0.176 not lived.Ping Test Failed
192.168.0.175 not lived.Ping Test Failed
192.168.0.189 not lived.Ping Test Failed
192.168.0.223 not lived.Ping Test Failed
192.168.0.207 not lived.Ping Test Failed
192.168.0.226 not lived.Ping Test Failed
192.168.0.169 not lived.Ping Test Failed
192.168.0.194 not lived.Ping Test Failed
192.168.0.228 not lived.Ping Test Failed
192.168.0.197 not lived.Ping Test Failed
192.168.0.229 not lived.Ping Test Failed
192.168.0.177 not lived.Ping Test Failed
192.168.0.230 not lived.Ping Test Failed
192.168.0.237 not lived.Ping Test Failed
192.168.0.247 not lived.Ping Test Failed
192.168.0.245 not lived.Ping Test Failed
192.168.0.242 not lived.Ping Test Failed
192.168.0.246 not lived.Ping Test Failed
192.168.0.241 not lived.Ping Test Failed
192.168.0.236 not lived.Ping Test Failed
192.168.0.244 not lived.Ping Test Failed
192.168.0.249 not lived.Ping Test Failed
192.168.0.250 not lived.Ping Test Failed
192.168.0.231 not lived.Ping Test Failed
192.168.0.238 not lived.Ping Test Failed
192.168.0.254 not lived.Ping Test Failed
192.168.0.233 not lived.Ping Test Failed
192.168.0.239 not lived.Ping Test Failed
192.168.0.235 not lived.Ping Test Failed
192.168.0.248 not lived.Ping Test Failed
192.168.0.253 not lived.Ping Test Failed
192.168.0.243 not lived.Ping Test Failed
192.168.0.240 not lived.Ping Test Failed
192.168.0.90 not lived.Ping Test Failed
192.168.0.113 not lived.Ping Test Failed
192.168.0.252 not lived.Ping Test Failed
192.168.0.232 not lived.Ping Test Failed
192.168.0.234 not lived.Ping Test Failed
192.168.0.251 not lived.Ping Test Failed

六翁狐、每周的工作日1:30,將/etc備份至/backup目錄中豪嗽,保存的文件名稱(chēng)格式 為“etcbak-yyyy-mm-dd-HH.tar.xz”谴蔑,其中日期是前一天的時(shí)間

[root@centOS8 ~]# vim /data/etcbak.sh

!/bin/bash

i

/usr/bin/tar -JcPf /backup/etcbak-date -d -1day +%F-%H.tar.xz /etc/ > /dev/null
crontab -e
crontab -l
30 1 * * 1-5 /backup/etcback.sh

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市龟梦,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌窃躲,老刑警劉巖计贰,帶你破解...
    沈念sama閱讀 222,000評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異蒂窒,居然都是意外死亡躁倒,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,745評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門(mén)洒琢,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)秧秉,“玉大人,你說(shuō)我怎么就攤上這事衰抑∠笥” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 168,561評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵呛踊,是天一觀的道長(zhǎng)砾淌。 經(jīng)常有香客問(wèn)我,道長(zhǎng)谭网,這世上最難降的妖魔是什么汪厨? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 59,782評(píng)論 1 298
  • 正文 為了忘掉前任,我火速辦了婚禮愉择,結(jié)果婚禮上劫乱,老公的妹妹穿的比我還像新娘织中。我一直安慰自己,他們只是感情好衷戈,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,798評(píng)論 6 397
  • 文/花漫 我一把揭開(kāi)白布抠璃。 她就那樣靜靜地躺著,像睡著了一般脱惰。 火紅的嫁衣襯著肌膚如雪搏嗡。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 52,394評(píng)論 1 310
  • 那天拉一,我揣著相機(jī)與錄音采盒,去河邊找鬼。 笑死蔚润,一個(gè)胖子當(dāng)著我的面吹牛磅氨,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播嫡纠,決...
    沈念sama閱讀 40,952評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼烦租,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了除盏?” 一聲冷哼從身側(cè)響起叉橱,我...
    開(kāi)封第一講書(shū)人閱讀 39,852評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎者蠕,沒(méi)想到半個(gè)月后窃祝,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,409評(píng)論 1 318
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,483評(píng)論 3 341
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了瘟判。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,615評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡探膊,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出待榔,到底是詐尸還是另有隱情逞壁,我是刑警寧澤,帶...
    沈念sama閱讀 36,303評(píng)論 5 350
  • 正文 年R本政府宣布究抓,位于F島的核電站猾担,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏刺下。R本人自食惡果不足惜绑嘹,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,979評(píng)論 3 334
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望橘茉。 院中可真熱鬧工腋,春花似錦姨丈、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,470評(píng)論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至趁冈,卻和暖如春歼争,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背渗勘。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,571評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工沐绒, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人旺坠。 一個(gè)月前我還...
    沈念sama閱讀 49,041評(píng)論 3 377
  • 正文 我出身青樓乔遮,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親取刃。 傳聞我的和親對(duì)象是個(gè)殘疾皇子蹋肮,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,630評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容

  • DAY27 一、知識(shí)點(diǎn)回顧 1璧疗、網(wǎng)絡(luò)坯辩? 1、 傳輸介質(zhì) 2病毡、 硬件 2濒翻、兩臺(tái)主機(jī)之間進(jìn)行通信? 3啦膜、交換網(wǎng)...
    chloepang閱讀 454評(píng)論 0 0
  • ▲就業(yè)班和全程班的小伙伴看這里:(學(xué)習(xí)老王視頻的作業(yè)第15-16節(jié)) 1、顯示統(tǒng)計(jì)占用系統(tǒng)內(nèi)存最多的進(jìn)程淌喻,并排序僧家。...
    一心1977閱讀 240評(píng)論 0 0
  • 多網(wǎng)卡綁定 ss 和 netstat 用來(lái)查看已啟動(dòng)的進(jìn)程和端口的對(duì)應(yīng)關(guān)系lsof -i :80 查看80端口...
    大白菜運(yùn)維閱讀 526評(píng)論 1 0
  • 編寫(xiě)腳本實(shí)現(xiàn)登陸遠(yuǎn)程主機(jī)使用 expect#!/usr/bin/expect -fset ip [lindex $...
    小馬閱讀 158評(píng)論 0 0
  • 第六周 day27 一知識(shí)點(diǎn)回顧 1、網(wǎng)絡(luò) 1傳輸介質(zhì) 2硬件 2兩臺(tái)主機(jī)之間進(jìn)行通信 3局域網(wǎng)交換網(wǎng)絡(luò) ...
    福娃_60ea閱讀 290評(píng)論 0 0