↧
Answer by steeldriver for conditional find output missing
Your test if [ "find /location/sub/int/ -size +1G" ] doesn't work the way you intend because it tests the non-emptiness of the string "find /location/sub/int/ -size +1G" - which will always be true. In...
View ArticleAnswer by Ravexina for conditional find output missing
One liner workaround: find -size +10G | grep ".*" > file.log || (rm file.log; echo "Can't find anything") Or: find -size +10G | grep ".*" > file.log || rm file.log Note that find returns 1...
View Articleconditional find output missing
Im trying to build a conditional statement to search for files of a certain size (in this case 1Gb. if [ "find /location/sub/int/ -size +1G" ] then > /location/sub/int/large_file_audit.txt fi I run...
View Article