Most powerful examples of Unix commands or scripts every programmer should know

后端 未结 25 1750
遇见更好的自我
遇见更好的自我 2021-01-29 18:14

There are many things that all programmers should know, but I am particularly interested in the Unix/Linux commands that we should all know. For accomplishing tasks that we may

25条回答
  •  情深已故
    2021-01-29 18:55

    To run in parallel several processes without overloading too much the machine (in a multiprocessor architecture):

    NP=`cat /proc/cpuinfo | grep processor | wc -l`
    #your loop here
        if [ `jobs | wc -l` -gt $NP ];
        then
             wait
        fi
        launch_your_task_in_background&
    #finish your loop here
    

提交回复
热议问题