Quantcast
Channel: conditional find output missing - Ask Ubuntu
Browsing all 3 articles
Browse latest View live

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 Article


Answer 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 Article


conditional 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
Browsing all 3 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>