3 ms·
> As part of my job currently, I am going to delete it. Go away, or I will turn you into a very small shell script. #!/bin/bash find / -name \*.sh -si
by AlexCoventry 9y ago
> As part of my job currently, I am going to delete it.
Go away, or I will turn you into a very small shell script.
#!/bin/bash
find / -name \*.sh -size +10k -type f -print0 | xargs -0 rm
- asfdsfggtfd 9y agoDoes this escape spaces in filenames properly?
- pvdebbe 9y agoFind's `-print0' will output results using null separation. Xargs' `-0' argument will treat input as null-separated.
- explainplease 9y ago$ mangle find -delete ACTIONS -delete Delete files; true if removal succeeded. If the removal failed, an error message is issued. If -delete fails, find's exit status will be nonzero (when it eventually exits). Use of -delete automatically turns on the -depth option. Warnings: Don't forget that the find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified. When testing a find command line that you later intend to use with -delete, you should explicitly specify -depth in order to avoid later surprises. Because -delete implies -depth, you cannot usefully use -prune and -delete together.
- aepiepaey 9y agoIs mangle an actual program that's publicly available? Searched for it but didn't find anything.
- explainplease 9y agohttps://github.com/alphapapa/mangle https://github.com/alphapapa/mangle
- AlexCoventry 9y agoThank you.