I know this one was answered before in forum below -
https://www.unix.com/unix-dummies-que...d-command.html
But that one is closed & I have a question so here it goes.
I want to delete all 2006 files. Now if along with the files, if the folder is even older (2006) then it should be deleted as well - if it has all 2006 files.
so how I do it?
1) Deleted 2006 - old files. -- DONE without any issues.
2)
Delete All Empty folders left after Step #1
Quote:
find ./ -type d -depth -mtime +1052 –print| xargs rm –f
But here is what I get -
$: find ./ -empty -type d
find: bad option -empty
find: path-list predicate-list
I dont wanna experiment on my PROD environment with below command -
Quote:
find ./ -type d -exec rmdir 2>/dev/null {} \;
This ideally deletes all the directories but gives warning before deleting it. Tricking it is a good idea, but not sure how my OS will behave (Sun Solaris Unix).
Is writing a script only way to get it done in that case?!!
Anyhelp will be appreciated.
Thanks,
Ked[COLOR="#738fbf"]