Shell script practice every day (1)

Practice questions

1. Create a Linux system account and password through location variables

Insert picture description here

2. Real-time monitoring of the machine's memory and the remaining space of the hard disk. When the remaining memory is less than 500M, and the remaining space of the root partition is less than 1000M, a prompt will be given

Insert picture description here

3. The script generates a random number within 100 and prompts the user to guess the number. According to the user's input, the user is prompted to guess the right, guess the small or guess the big, until the user guesses the right script.

Insert picture description here

4. Check whether the current user of the machine is a super administrator, if it is an administrator, use yum to install vsftpd, if not, then prompt you to be a non-administrator (use string to compare versions)

Insert picture description here

5. Detect whether the current user of the machine is a super administrator, if it is an administrator, use yum to install vsftpd, if not, then prompt you to be a non-administrator (use UID digital comparison version)

Insert picture description here

Guess you like

Origin blog.csdn.net/Lucien010230/article/details/114503333