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, how do you get list of all python files in current directory, and all subdirectories under current directory (i.e. all files ending in the .py file extension)
Answer

find . -name '*.py'

^^ note the use of -name flag

^^^ note the use the shell pattern *.py (note this is globbing not regex syntax).

^^^^ note the pattern is provided within single quotes, if it was full name of file, then you don't need the quotes but for patterns you do


Question
In linux, how do you get list of all python files in current directory, and all subdirectories under current directory (i.e. all files ending in the .py file extension)
Answer
?

Question
In linux, how do you get list of all python files in current directory, and all subdirectories under current directory (i.e. all files ending in the .py file extension)
Answer

find . -name '*.py'

^^ note the use of -name flag

^^^ note the use the shell pattern *.py (note this is globbing not regex syntax).

^^^^ note the pattern is provided within single quotes, if it was full name of file, then you don't need the quotes but for patterns you do

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

20. Advanced Shell Scripting
p 1 wait $DIG_PID ) 2>/dev/null | grep -q '^[^;]*netscape.com' && break done 20.7.5 Recursive grep (search) Recursively searching through a directory tree can be done easily with the <span>find and xargs commands. You should consult both these man pages. The following command pipe searches through the kernel source for anything about the ``pcnet'' Ethernet card, printing also

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.