Filter folders whose name is a timestamp - pattern matching vs. regex matching using the find utility
问题 I am writing a generic shell script which filters out files based on given regex. My shell script: files=$(find $path -name $regex) In one of the cases (to filter), I want to filter folders inside a directory, the name of the folders are in the below format: 20161128-20:34:33:432813246 YYYYMMDD-HH:MM:SS:NS I am unable to arrive at the correct regex. I am able to get the path of the files inside the folder using the regex '*data.txt' , as I know the name of the file inside it. But it gives me