shell - Explain how many processes created? -



shell - Explain how many processes created? -

could reply how many processes created in each case commands below dont understand :

the next 3 commands have same effect:

rm $(find . -type f -name '*.o') find . -type f -name '*.o' | xargs rm find . -type f -name '*.o' -exec rm {} \;

exactly 2 processes - 1 rm, other find. 3 or more processes. 1 find, xargs, , 1 or more rm. xargs read standard input, , if reads more lines can passed parameters programme (there maximum value named arg_max). many processes, 1 find , 1 each file ending in .o rm.

in opinion, alternative 2 best, because handles maximum parameter limit correctly , doesn't spawn many processes. however, prefer utilize (with gnu find , xargs):

find . -type f -name '*.o' -print0 | xargs -0 rm

this terminates each filename \0 instead of newline, since filenames in unix can legally contain newlines. handles spaces in filenames (much more common) correctly.

shell process find

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -