Last active
November 1, 2021 20:00
-
-
Save KrisYu/14caa25113b1f3e4a3afbd70d3a991d7 to your computer and use it in GitHub Desktop.
delete some files in a path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
files = os.listdir() | |
# files is a string list | |
for filename in files: | |
print(filename) | |
# https://askubuntu.com/questions/443830/delete-all-files-whose-filenames-contain-a-particular-string | |
# remove a file with *text using shell | |
# rm *text* | |
# or run with python3 | |
# os.system('rm *line*') | |
# os.system('rm *hybrid*') | |
# os.system('rm *traditional*') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment