I have been searching Google for ways to move a large number of files using the Linux command line.
What I have is several hundred PDF files in a single folder. Each file has a date assigned to it. What I need to do is to create a sub-folder with a year assigned to it. I know I can create multiple folders or directories using the following:
mkdir 2019 2020 2021
What I need to do is move all 2019 files into the 2019 folder, all 2020 files in the 2020 folder, etc.
My Professor recommended I use GREP to display the files, then pipe the output into the Move command.
My understanding was GREP was used for search for text strings within text files and not really for files in a directory.
Can someone please shed some light on this?