subdirectory - Unix deleting subfolders with names in YYYYMMDD that are older than 30 days -


i'm looking simple line of code (if possible) delete subfolders names in yyyymmdd older 30 days. have searched related solutions online , came this. i'm sure there's i'm missing here because when submitted this, no subfolders older 30 days deleted , not getting errors either.

find /my/directory -type d -name '[0-9]{8}' -mtime +30 -exec rm -rf {} \;

use -regex flag in find.

find /my/directory -type d -regex "[0-9]{8}" -mtime +30 -exec rm -rf {} \; 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -