List
Description
Solution
foreach ($file in $(ls)) {
$contents = $(cat $file)
if ($contents -match "<title>404 Not Found</title>" -or # Delete invalid pages
$contents -match "<title>403 Forbidden</title>" -or # Delete invalid pages
$contents -match "<title>400 Bad Request</title>" -or # Delete invalid pages
$contents -match "<pre></pre>" -or # Delete empty php scripts
$contents -match ".*\..*" # Delete anything without extension
) {
rm $file
}
}Last updated