2018年8月1日 星期三

[Linux 常見問題] How can I list only non-empty files using ls?

Source From Here 
Question 
How can I list all files that are not empty (size > 0) using linux? 

How-To 
I'd use find -not -empty -ls, assuming GNU find. The alternative way is: 
// -maxdepth 1: - this tells find to search the current dir only, remove to look in all sub dirs or change the number to go down 2, 3 or more levels. 
// -size +0: this tells find to look for files with size larger than 0 bytes. 0 can be changed to any size you would want. 
// -print: tells find to print out the full path to the file it finds
 
# find -maxdepth 1 -size +0 -print


沒有留言:

張貼留言

[ JS 常見問題 ] Javascript Date output formatting

Source From  Here   Question   I need to  capture the Now() date and time in the YYYY/mm/dd hh:m:sec format . It needs to be in GMT time. Ho...