handling10 {One/* error occurred */fprintf (stderr, "Fork failed!");Exit (-1);14}All else if (PID = = 0)16 {+/ * Child process */subprocess pid=0 if and else will execute the C7>fork system calls are returned once in the parent and child processesprintf ("This is a child process!\n");19}Else21 {*/* Parent Process */printf ("This is the Parent
than tmp.txt files or directoriesfind/home-anewer tmp.txt A file or directory that is accessed more than tmp.txt near/ homefind/home-used-2 lists files or directories that have been accessed within 2nd after the file or directory has been alteredfind/home-user CNSCN lists files or directories in the/home directory that belong to the user Cnscnfind/home-uid +501 lists files or directories with a user's ID greater than 501 in the/home directoryFind/hom
adjustment amount is 0. at this point the parent-child process Nice values are .The results of the operation are as follows: You can see that the nice is the parent-child process . so in Ten In seconds, the parent-child process computes basically the same. You can assume that a parent-child process consumes the same
created by the process. (fork) Thread. (4) Relatively speaking, the thread consumes CPU, and the memory is less than the process.(2) in Linux, each executed program is called a process. Each process is assigned an ID number, and
"-exec Cat {} \;>all_c_files.txt #找到所有C文件并拼接起来写入单个文件all_c_files. txt. The output of the Find command is a single data stream, so do not append >>Find/mnt-name tom.txt-ftype vfat #在/mnt to find files with the name Tom.txt and file system type VFATFind/mnt-name Tom.txt! -ftype vfat #在/mnt to find files with name Tom.txt
Find directory: Find/(Look in)-name ' find keyword '-type dFind files: Find/(Look in)-name look up keywords-printIf you need further information, you can refer to the Linux command in detail.Here are some excerpts:find Path-option [-print] [-exec-ok command] {}/;#-print outp
Find directory: Find/(Look in)-name ' find keyword '-type dFind files: Find/(Look in)-name look up keywords-printIf you need further information, you can refer to the Linux command in detail.Here are some excerpts:find Path-option [-print] [-exec-ok command] {}/;#-print outp
One linux Command (21) every day: Link to the find command xargs: One linux Command (1) every day: ls command running (2): cd command http://www.bkjia.com/ OS /210210/163050.html#linuxcommand every day (3 ): pwd command Export (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxcommand every day (5): rm command Export (6): rmdir command http://
function.
#include <unistd> pid_t getpid(void); pid_t getppid(void);
The process serves the program, and the program serves the user. in order to find the User Name of the process, the system also establishes contact with the user for the process
we often find a file in Linux, but we do not know where to put it, you can use some of the following commands to search.These are the information found on the Internet (reference 1), because sometimes it is not used for a long time, and when it is used, it is often confused, so it is easy to use.
which viewing the location of an executable file
Whereis Viewing the location of a file
Locat
placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times, we want to start in the background, you can start the parameters with a
signal, which often brings some side effects, such as data loss or the terminal cannot be restored to normal. When sending a signal, you must be careful. Only when you have to do so can you use the kill signal (9), because the process cannot capture it first. To cancel all background jobs, enter kill 0. Some commands run in the background will start multiple processes, and it is very troublesome to trace and find
called the terminating state or exit state, if (a) calls these functions without parameters, (b) The return statement in the main function has no return value, (c) The main function does not declare that the return type is integral, then the terminating state of the process is undefined. The main function returns an integer value that is equivalent to calling exit with that value.Function name: Exit () header file: Stdlib.h (if the conversation file
Linux under Find command instance
$find ~-name "*.txt"-print #在 $HOME to check the. txt file and display the
$find. -name "*.txt"-print
$find. -name "[a-z]*"-PRI26NBSP; #对匹配的文件使用cpio命令, back them up to the
tape device-prune #忽略某个目录
$
Simply list the basic commands and share only my thoughts!based on Linuxkernel is multi-tasking OS,Windows NT Kernel is a single multitasking os,os Kernel features nothing but "connecting" That is, drive hardware, provide system calls for upper-level applications, memory management,FS Management, Process management , and so on, so the Linux process, threading mec
find the culprit that consumes most of the system's resources. Of course, once found, the next step is to end these processes. This is the next topic.Ii. End Process Linux process signalHow to kill a processKill ID (PID)3940-bash:kill: (3940)-Operation not permittedThe abov
/S100msg. sh // generate soft link
Method 2: chkconfig: only services installed by default can be changed.
Directly hitting chkconfig will list its usage. The usage is very intuitive and simple and requires installation!
Chkconfig -- list lists all service programs in the default state at each running level.
Chkconfig -- list sshd only displays the sshd startup status
...
Method 3: ntsysv
If ntsysv is hit, the startup setting of the current running level is changed.
Other running levels: ntsys
perform the specified operation. In Linux, the find command provides many search conditions and has powerful functions. Because find has powerful functions, there are many options, and most of them are worth the time to understand. Even if the system contains a Network File System (NFS), the find command is equally va
lot, a start without a clue, but catch the keyword ' Process ', and around the status of the process, you can find a step-by-step operation of the Linux operating system, because the system does not know much, there is no contact with other operating system source code, no contrast, I hope in the next study, will have
everyone to search the Internet (Linux kill), if not too much trouble, do not want to learn too many related , just do what I said before. Of course, because the top command shows a limited number of processes, you may not be able to see all the relevant processes in the top list, if the kill half did not kill half, the next thing will be more trouble, so there will be the following PS command introduced the appearance, It's a practical command to ac
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.