1)find /home/username/mail/new -name "123*" -exec rm -fv {} \;
Replace the "123*" entry with a prefix of what your files within this directory start with. This is a safeguard so you do not use the command incorrectly and delete files you are not supposed to. Ensure you are careful with the directory that you enter in this command because we do not generally recommend mass deletion of files.
2)find ~/user/images/* -maxdepth 1 -type f | wc -l
It will show you the count of images present under specified folder.
3)find /newdata/active_images/images -type f -iname "*.jpg"
output =>
/newdata/active_images/images/9780548358559.JPG
/newdata/active_images/images/9781240551071.jpg
/newdata/active_images/images/9781286130742.jpg
3) root@host [/newdata/active_images]# cat rm.php
// Specify the target directory and add forward slash
$path = "images/";
// Loop over all of the files in the folder
foreach(glob($path ."*") as $file) {
unlink($file); // Delete each file through the loop
}
?>
=> This script delete all files present under image folder.
Replace the "123*" entry with a prefix of what your files within this directory start with. This is a safeguard so you do not use the command incorrectly and delete files you are not supposed to. Ensure you are careful with the directory that you enter in this command because we do not generally recommend mass deletion of files.
2)find ~/user/images/* -maxdepth 1 -type f | wc -l
It will show you the count of images present under specified folder.
3)find /newdata/active_images/images -type f -iname "*.jpg"
output =>
/newdata/active_images/images/9780548358559.JPG
/newdata/active_images/images/9781240551071.jpg
/newdata/active_images/images/9781286130742.jpg
3) root@host [/newdata/active_images]# cat rm.php
// Specify the target directory and add forward slash
$path = "images/";
// Loop over all of the files in the folder
foreach(glob($path ."*") as $file) {
unlink($file); // Delete each file through the loop
}
?>
=> This script delete all files present under image folder.