The following is what I want to do but I dont know how to do it.
1.Delete multiple directories and their subdirectories.I want all files that ends with BSCXXX eg APSTBSC1,MTCBSC23 etx
2.Then I would like to use crontab to delete these folders after every 15 mins
3.Folders are in this path /opt/var/test (thus where APSTBSC1 etc are.No worry about subdirectories)
I use the command rm -rf directory but i came across the following article : Article
That suggests that rsynch to an empty folder is the fastest way? rsync -a –delete empty/ a Why is this the case ?
Is there another faster method to delete a nonEmpty folder ?
In an old version of Unix, the rm command would delete directories if they were empty. From the Research Unix Eighth Edition man page for rm: "If an entry is a directory it is removed only if empty." I like this behaviour, so I've got this alias in my /etc/profile: alias rm='rm -d' I'm using the GNU coreutils version of rm, in which -d tells rm to go ahead and remove directories if they're empty.
I am having the same problem as described here since two weeks. I even did not notice it at first.I know the workaround, deleting it also with shift + del. But why is that now? I cannot even delete files on all Windows file systems as root.
Chance is that there will be empty files (zero byte files) and empty directories (that doesn’t contain any files) in your system. In this article, I will show you how to locate these empty directories and files and delete them.
The command you can use is the "find" command. To find empty directories in the current directory, you use the option -empty: