Answer the question
In order to leave comments, you need to log in
How to bulk delete files by name?
In general, there is a list that shows the full paths to the files:
example:
uploads/posts/2012-02/samurai-samourai-le.jpg
uploads/posts/2012-02/dva.jpg
uploads/posts/2012-02/ teoriya-zapoya.jpg
All these files should be deleted.
Because in puff is not strong, the question is: is there a command to perform a similar function in Linux?
Answer the question
In order to leave comments, you need to log in
xargs rm < список.txt
PS Before executing, do not forget to go to the directory where the uploads directory is located or the list should consist of absolute paths to files.
#!/bin/bash
while read filepath; do
rm -fv "$filepath"
done < path/to/filelist.txt
rm -R -f .../2012-*
-R recursion- kill directory by mask.
-f will not ask, everything will crash right away.
>Because I’m not strong in puff, the question
is, how about Linux has already been answered, if necessary in PHP then:
<?php
$lines = file('1.txt');
array_map(function($l) {
unlink(trim($l));
}
, $lines);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question