How linux deletes files based on the name suffix

how to delete files such as .py files based on the suffix of file names in linux

for example, now I just want to delete the data at the end of py

Jan.29,2022

rm *.py

  1. find. -name "* .py" | the xargs rm
    command is very dangerous. Execute the first half of the command to see if it is the file you want to delete, and execute
  2. on the whole.
  3. rm-I * .py delete all files with the suffix py; ask for confirmation one by one before deleting
Menu