OK. First, some basic questions.
Why?
-Is it to save space on your hard drive?
- Is it to reduce visual clutter?
- Does it affect the logic of a process?
Also, you have enough drive space to allow temporary storage?
Are you sure a
bash command is the best method for you?
- Some users would use visual interface, but you can do it in the terminal mode swith a few commands
We assume you have a backup plan already in place.
As for me, I am lazy and do not like to make bad mistakes. So I would make the computer do the work. So this is what I do in case I want to zap just old files.
Make a sibling directory named 'temp'. (A sibling is a directory alongside the working you use.)
Copy all
new files and directories to the 'teemp' directory.
(In Windows you would use Xcopy. In Linux you might use 'cp' or another utility.
Next, if all goes well, delete all in the working directory.
Last step is move contents of the temp dir working dir.
This can be don e one step at a time and you can view the progress.
Others here can find a more elegant solution.
![Wink ;)](https://www.computerhope.com/forum/Smileys/classic/wink.gif)