Look at the following pictures to write a sh file needs to be like this: the requirement is first determines the file type is the state file if it is the state file name to all types of files deleted and the directory is all prefixes are 213037199 three files deleted but not die file name for finish this sh file long-term use next time will not necessarily appear prefix is 213037199 file
CodePudding user response:
CD file directory
Ls | while read the file
Do
If [" ${file# *.} "==" state "]. Then
Echo ${file %. *} *
Fi
The done
# to delete, you can change the echo to rm