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


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...