Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

In linux, complete the following command that finds all python files in current directory (and subdirectories below) and deletes them:

find . -name '*.py' [...]

Answer

find . -name '*.py' | xargs rm

^^ note the use of xargs (i.e. how xargs takes all the output from find, seperates it by whitespace/newline, and feeds it to the rm command, one by one, as command line args)


Question

In linux, complete the following command that finds all python files in current directory (and subdirectories below) and deletes them:

find . -name '*.py' [...]

Answer
?

Question

In linux, complete the following command that finds all python files in current directory (and subdirectories below) and deletes them:

find . -name '*.py' [...]

Answer

find . -name '*.py' | xargs rm

^^ note the use of xargs (i.e. how xargs takes all the output from find, seperates it by whitespace/newline, and feeds it to the rm command, one by one, as command line args)

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
;& break done 20.7.5 Recursive grep (search) Recursively searching through a directory tree can be done easily with the find and xargs commands. You should consult both these man pages. The <span>following command pipe searches through the kernel source for anything about the ``pcnet'' Ethernet card, printing also the line number: find /usr/src/linux -follow -type f | xargs grep -iHn pcnet (You will n

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.