Experiment 7: Process Management of Linux System

Experiment 7: Process Management of Linux System

1. Use the at command to create an empty file test.txt in your name directory 2 minutes after the current time

Execute first means to execute at now + 2minutesafter two minutes, enter the statement to be executed after pressing Enter, and CTRL+D to exit.
Insert picture description here

Install without installing at package execution sudo apt-get install at.

2. Use the batch command to create an empty file test2.txt in the name directory;

Similar to the at command, but batch is executed when the virtual machine is idle. Exit is also CTRL+D.
Insert picture description here

3. Use the crontab command to create a task in the name directory, and execute touch test3.txt once a day at 8:10;

Crontab command usage:crontab [-u 用户名] [ -e | -l | -r ]

-u specifies the user name to define the task scheduling, without this option, the current user is defaulted;

-e is used to edit the user's cron scheduling file;

-l is used to display the contents of cron scheduling files;

-r is used to delete the user's cron scheduling file.

First crontab -e edit the scheduling file, enter the statement in the figure below, ctrl+x to exit.
Insert picture description here

4. Display all processes in long format

Option e means displaying all processes; option l means displaying in long format.
Insert picture description here

5. Start the text editor gedit, check the gedit process ID, and then terminate it with the kill command;

Insert picture description here

6. Use the top command to view the system status, and output the results of the second update display to the file named top.log.

Insert picture description here

Insert picture description here

top -d 2 -n 1 -b > top.log

-d 2 means refresh every 2 seconds

-n 1 means output the result once in the file

-b means the file is readable

Guess you like

Origin blog.csdn.net/qinnt/article/details/110728483