Delete all pyc files under the specified directory

Delete all pyc files under the specified directory

Delete command

$ find <directory name> -name '*.pyc' -delete

Example) Delete all pyc files under the ~ / project directory

#Search
$ find ~/project -name *.pyc
/Users/xxx/project/django1.5/mysite/mysite/__init__.pyc
/Users/xxx/project/django1.5/mysite/mysite/settings.pyc
/Users/xxx/project/django1.5/mysite/mysite/urls.pyc
/Users/xxx/project/django1.5/mysite/mysite/wsgi.pyc
#Delete
$ find ~/project -name *.pyc -delete
#Search
$ find ~/project -name *.pyc
None

Recommended Posts

Delete all pyc files under the specified directory
Unzip all zip files under the current directory
List all files under the current directory line by line with full path
Drop all CSV files under any directory into DataFrame
File access under the directory
[Linux] Directory under the root
How to list files under the specified directory in a list (multiple conditions / subdirectory search)
Recursively copy files from the directory directly under the directory using Python
Check what the character code is for all files under the directory that is Python and output
Run all unittests under a directory
Compress all the text files below!
Delete tweets for the specified period
Search for files with the specified extension
Read all csv files in the folder
[linux] Split files to the specified size
How to read all the classes contained in * .py in the directory specified by Python
Search for files with line feed code CR + LF under the current directory
Python script that makes UTF-8 files with all BOMs under the folder without BOMs
Access files in the same directory as the executable
Recursively search all files with multiple specified extensions
Recursively search the specified directory to see the file
Delete the substring
Checks if there is a specific character string for all files under the directory that is Python and outputs the target line
[Django] Perform Truncate Table (delete all data in the table)