> ## Content Index
> Fetch the complete content index at: https://www.bagz.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Move files with a specific extension older than x days
- URL: https://www.bagz.fr/move-files-with-a-specific-extension-older-than-x-days/
- Published: 2015-07-20T08:39:53.000Z
- Updated: 2015-07-20T08:39:53.000Z
- Author: bgazui
- Tags: Linux, #Migrated-1790668826633, #wp, #wp-post, #Import 2026-09-29 08:00

Need to move or remove a list of files with a particular extension, a particular filename pattern and/or not changed since a specific date?

This can be done by combining an action to perform with the result of a *find* command.

- Moving files called "*FILES\*.csv*" with a modification date older than 10 days:

find /old/directory/ -name "FILES\*.csv" -type f -mtime +10 -exec mv "{}" /destination/directory/ \\;

- Remove all files older than 30 days with a name starting by "*temp*" in the "*/tmp*" folder without any recursion:

find /tmp/ -maxdepth 1 -name "temp\*" -type f -mtime +30 -exec rm "{}" \\;Besoin de déplacer ou supprimer une liste de fichiers avec une extension particulière, un format de nom de fichier spécifique et/ou qui n'ait pas été modifié depuis une certaines date ? Ceci peut être fait en combinant une action à exécuter avec les résultat d'une commande *find*.

- Déplacer des fichiers appelés "*FILES\*.csv*" avec une date de modification de plus de 10 jours :

find /old/directory/ -name "FILES\*.csv" -type f -mtime +10 -exec mv "{}" /destination/directory/ \\;

- Supprimer tous les fichiers plus anciens que 30 jours avec un nom commençant par "*temp*" dans le répertoire "*/tmp*" sans récursivité :

find /tmp/ -maxdepth 1 -name "temp\*" -type f -mtime +30 -exec rm "{}" \\;