Linux课程教学实习要求

时间:2021-07-11 03:19:11
【文件属性】:

文件名称:Linux课程教学实习要求

文件大小:22KB

文件格式:DOC

更新时间:2021-07-11 03:19:11

Linux

设计要求: 1. 基本shell编程,要求选择两项编程:(截图保存成姓名+学号的word文档) (1)创建用户 (2)创建目录和文件 (3)备份文件 (4)查找统计 (5)进程管理 (6)系统信息 (7)加减乘除运算,其中 两个操作数和一个运算符由位置参数给出 在屏幕上分别显示操作数、运算符和运算结果. (8)按照运行结果编写Shell程序: (9)逆序输出一个字符串 (10)冒泡法对10个数按升序排序 (11)编写1个menu的Shell程序。 #!/bin/bash date; echo "uptime:" uptime echo "Currently connected:" w echo "--------------------" echo "Last logins:" last -a |head -3 echo "--------------------" echo "Disk and memory usage:" df -h | xargs | awk '{print "Free/total disk: " $11 " / " $9}' free -m | xargs | awk '{print "Free/total memory: " $17 " / " $8 " MB"}' echo "--------------------" start_log=`head -1 /var/log/messages |cut -c 1-12` oom=`grep -ci kill /var/log/messages` echo -n "OOM errors since $start_log :" $oom echo "" echo "--------------------" echo "Utilization and most expensive processes:" top -b |head -3 echo top -b |head -10 |tail -4 echo "--------------------" echo "Open TCP ports:" nmap -p- -T4 127.0.0.1 echo "--------------------" echo "Current connections:" ss -s echo "--------------------" echo "processes:" ps auxf --width=200 echo "--------------------" echo "vmstat:" vmstat 1 5


网友评论