Removing files matching a numeric range regular expression
35
Solution 1
You can try
rm some-files-with-numbers{0..300}
This will delete:
some-files-with-numbers0
some-files-with-numbers1
some-files-with-numbers2
...
some-files-with-numbers300
Solution 2
I like superuser’s answer, but to add another possibility:
find . -regex './some-files-with-numbers[123]?[0-9]?[0-9]' -delete
Related videos on Youtube
Author by
L.Nick
Updated on September 18, 2022Comments
-
L.Nick almost 2 years
<cfif NOT DirectoryExists(ExpandPath(lv_upload_path))> <cfdirectory action="create" directory="#ExpandPath(lv_upload_path)#"> </cfif> <cfset lv_file_ext = listLast(FORM.filename_inv, ".") /> <!--- replace special chars in comapny name except space, then replace space with underscore ---> <cfset company_name = replaceSpecialChars( textString=FORM.company_name, replaceTheseChars="33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,58,59,60,61,62,63,64,91,92,93,94,95,96,123,124,125,126" )> <cfset company_name = Replace( company_name, "#Chr(32)#", "_", "All" )> <cfset lv_file_name = company_name & "_Factura_" & replaceSpecialChars(FORM.in_supplier_inv) & "_" & DateFormat(FORM.in_when_inv, "dd.mm.yyyy") > <cfset lv_file_name_out = lv_file_name & "." & replaceSpecialChars(lv_file_ext)> <cffile action="upload" filefield="pickfiles_inv" destination="#ExpandPath(lv_upload_path & '/' & lv_file_name_out)#" nameconflict="MakeUnique"> <cfset lv_document_name = CFFILE.serverfile /> <cfset new_id = APPLICATION.po_management.f_savePOInvDocuments( p_po_inv_id=URL.id, p_supplier_number=FORM.in_supplier_inv, p_when_created=FORM.in_when_inv, p_amount=FORM.in_amount_inv, p_document_name=lv_document_name
Im new so if I make incorrect question, just help with how make it more good in future.
When upload a file give error back
Element FILENAME_INV is undefined in FORM.
-
Adonis almost 7 yearsIf you want to write a good question (which in turn will help you receive more help), I would suggest you read: stackoverflow.com/help/mcve
-
Beginner almost 7 yearsStart with dumping
form
scope to see whether the element is available? -
L.Nick almost 7 yearsthank you very much, I will
-
-
cYrus almost 12 yearsWhat about
some-files-with-numbers301
? -
qdii almost 12 years@cYrus I am aware of the limitations :) My answer was more aimed at being an alternative to superuser’s one.