Scheduled Tasks, process management, and disk management for Linux study notes
Source: Internet
Author: User
Differences between scheduled tasks, process management, and disk management processes and programs in Linux learning Notes: 1. a program is a static concept, which is stored as a software resource for a long time; A process is the execution process of a program. it is a dynamic concept and has a certain life cycle. it is generated and extinct dynamically. 2. programs and... differences between scheduled tasks, process management, and disk management processes and programs in info Linux learning Notes: 1. programs are static concepts and are stored for a long time as software resources; A process is the execution process of a program. it is a dynamic concept and has a certain life cycle. it is generated and extinct dynamically. 2. there is no one-to-one correspondence between programs and processes. A program can be shared by multiple processes. on the other hand, a process can execute several programs in sequence in the activity: www.2cto.com parent process and child process: 1. a child process is a process generated by a process. The process that generates this child process is called the parent process. 2. in Linux, use the system to call fork to create a process. Fork copies the data and stack segments of the parent process, as well as the process environment of the parent process. 3. the parent process stops the child process and ends the foreground process and the background process. foreground process: after a command is run in the Shell prompt, create a sub-process, run the command, and Shell waits for the command to exit, and then returns to give a prompt to the user. This command is run asynchronously with Shell, that is, in the foreground. before it is completed, the user cannot execute another command background process: enter the command at the Shell prompt &, the sub-process created by Shell runs this command, but returns a prompt to the user without waiting for the command to exit. This command is run in sync with Shell, that is, in the background. The background process must be non-interactive. For example, view user information: w. [root @ CentOS-Test dhcp] # w 14:57:48 up, 3 users, load average: 0.00, 0.00, 0.00 user tty from login @ idle jcpu pcpu what root tty1-8: 18 m 0.11 s 0.11 s-bash root tty7: 0 8: 23 m 19: 19/usr/bin/Xorg: 0-br-verbose-audit 4-auth/var/run/TPD/au root pts/3 192.168.0.211 06 0.00 s 0.42 s 0.14 s w JCPU: distinguished by terminal code, when all the related processes on the terminal are executed, the CPU time consumed will be displayed here: PCPU: CPU execution time consumed by the program. WHAT: The user is Load average: displays the average load of the system in the past 1, 5, and 15 minutes FROM: displays where the user logs on to the system ,": 0 "indicates that the user is logged on from the XWindow, and the IDLE of the text mode window is opened: the time displayed by the user. This is a slap in the face timer. once you perform any operation, the timer will be reset to view the information of individual users: w user name to view the details of the processes that belong to you. ps-aux or ps-le [root @ CentOS-Test dhcp] # ps-aux Warning: bad syntax, perhaps a bogu '-'? See/usr/share/doc/procps-3.2.8/faq user pid % CPU % mem vsz rss tty stat start time command root 1762 0.0 0.0 2004 480 tty2 Ss +/sbin/mingetty/ dev/tty2 root 1764 0.0 0.0 2004 480 tty3 Ss +/sbin/mingetty/dev/tty3 PID: process No. PPID: Process No. of the parent process TTY: Terminal started by the process STAT: current state of the process S: sleep state D: non-interrupted sleep state R: running state Z: dead State T: stop NI: priority of the process to find whether a process has started ps-le | grep httpd to find whether a user's process has started ps-uU root or ps-aux | Grep root kill process: kill process no. kill-9 process No. (force close) kill-l process No. (restart process) xkill: close the graphic process killall: stop all processes pgrep service name: find service process no. pkill process name: close process nice: specify program running priority (-20-19) nice-5 myprogram nice -- 5/etc/rc. d/init. d/httpd start renice: change the priority of the running process renice-20 pid nohup: make the process continue after the user logs out, the nohup command stores the executed data and error information to the file nohup by default. out: format: nohup program & nohup find/-name init *>/root/find. init.20120120 & save the command execution result to/root/f Ind. in the init.20120120 file, process suspension and Restoration: suspension: ctrl + z termination: ctrl + c process resume to the foreground continue running: fg resume to the background continue running: bg view suspended processes: jobs top command: process status display and process control, automatically refresh every five seconds (dynamic display) common options: d: specify the interval of refreshing c: display the entire command line, not just the command name 15th, the command to plan the task: 1. one-time scheduled task at scheduled task execution at a specific time at [-f file name] time, there are two formats of time: absolute timing method: midnight noon teatime hh: mm [today] hh: mm tomorrow hh: mm week hh: mm MM/DD/YY relative timing method: now + n minutes now + n hours now + n days at execution result and configuration file: if/etc/. allow file exists, that Only users listed in this file can use the at command. if the/etc/al. allow file does not exist, check whether the/etc/at. deny file exists. If/etc/at. deny exists, users listed in this file cannot use the at command. If neither file exists, only the root user can use it. if both files exist and are empty, all users can use the at command batch to schedule a job to run once when the system load is not heavy. 2. the periodic scheduled job crontab is scheduled to run cyclically. the job crontab-e minutes 0 hours 4 days * months * weeks * the Command/script fills in the specific time known, if you do not know how to use * instead of 15, the file system structure/usr/bin,/bin: stores all the commands that can be executed by users/usr/sbin,/sbin: command/home: the default directory/proc: virtual file system, and the current memory Image/dev: The device file/lib: store the shared library/lost + found required by the system program running: store some system error check results/tmp: store users' temporary files/etc: System configuration file/var: contains frequently changed files, such as emails, log files, and scheduled tasks./usr: stores all commands, databases, and manual pages./mnt: installation point of the temporary file system/boot: kernel file and bootstrap file storage location device Mount partition and formatting principle disk quota file system common commands 1, df-m or df-h :: view disk partitions or folder size 2. View files, directory size 3, fsck, e2fsck-p partition name to detect and repair the file system, run in single user mode 4. file to determine the file type 5. mount the optical drive: mount/dev/cdrom/mnt/cdrom: umount/mnt/cdrom add disk or partition 1. partition (fdisk): shut down, add hard disk, after restarting, check whether the data is successfully added in coms or use dmesg | grep sdb to View disk information (size) using fdisk-l sdb. 2. partitions: fdisk/dev/sdb m: Get help information p: print hard disk partition table n: print new partition press enter: e: Extended partition p: primary partition and then Partition number (1-4) press enter on the start cylinder to terminate the cylinder + numM w: Save 3. restart the computer 4. create a file system (equivalent to windows formatting) msfs. ext4/dev/sdb1 5. mount the partition and create a folder in the root directory, [root @ CentOS-Test/] # mkdir web mounts sdb1 to the web [root @ CentOS-Test/] # mount/dev/sdb1/web // after the mounting is restarted failed to view mounting status [root @ CentOS-Test/] # df-h file system capacity in use % available mount point/dev/sda1 9.7G 3.2G 6.0G 35%/dev /sdb1 9.9G 151 M 9.3G 2%/web
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service