Languages and Scripting

How to list/copy/move/delete/etc all the files within a directory within specific dates range

 
Yaboto
Super Advisor

How to list/copy/move/delete/etc all the files within a directory within specific dates range

Hi,

The files are so many that you cannot even #cd to the directory talkless of #ll.

To trim down the directory contents, i have decided to #mv all the oldest files by specifying some years.

Please advice on the syntax and how to go about it in general.

Thanks!

1 REPLY 1
Steven Schweda
Honored Contributor

Re: How to list/copy/move/delete/etc all the files within a directory within specific dates range

> Please advice on the syntax and how to go about it in general.

   I'd use "find".  The "-exec <command> \;" option lets you do almost
anything with the selected file(s).  See, for example, the following
recent thread:

      https://community.hpe.com/t5/x/x/m-p/6976518