Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux filtration empty file command summary     - Android memory optimization of the memory cache (Linux)

- How comprehensive resist attacks from the network (Linux)

- Java open source monitoring platform Zorka basic use (Linux)

- Incremental garbage collection mechanism for Ruby 2.2 (Programming)

- Debian Stable (Jessie 8.1) of normal.mod not found (Linux)

- MySQL event table to achieve timing build a small note (Database)

- Debian installation (Linux)

- printf PHP string operations () built-in function usage (Programming)

- Pydev installed and configured on the Eclipse (Linux)

- Usage of sudo (Linux)

- CentOS 6 rapid deployment of Java applications (Linux)

- CentOS / Linux SWAP partitions added (Linux)

- Lua4.0 interpreter entrance (Programming)

- Realize screen recording and playback via Linux command (Linux)

- Java learning problems encountered (Programming)

- Close and limit unused ports computer server security protection (Linux)

- Swift 2.0 brief (Linux)

- Text editing and viewing text Linux command (Linux)

- 10 useful Linux command Interview Questions and Answers (Linux)

- Linux operating system security settings initial understanding (Linux)

 
         
  Linux filtration empty file command summary
     
  Add Date : 2017-12-01      
         
       
         
  There are often done in Linux file operations, and today a colleague in a production environment statistics, found that many log files are empty, too many documents, he wanted to look at what file is not empty.

But also do not want to use the script, I wanted to use a command to get really a lazy person enough. Simple simulation under. I want to see e.lst because its size is not empty.
 

DUM1102 / oravl01 / Oracle> ll * .lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 a.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 b.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 c.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 d.lst
 -rw-r - r-- 1 oracle dba 7 Jul 21 15:39 e.lst
 
The most streamlined command is to use the grep.
 DUM1102 / oravl01 / oracle> ll * .lst | grep -v "0"
 -rw-r - r-- 1 oracle dba 7 Jul 21 15:39 e.lst
 
Of course, you can also use awk to complete.
 Difficulty and then look to upgrade, add a file f.lst now the file structure is as follows:
 DUM1102 / oravl01 / oracle> ll * .lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 a.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 b.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 c.lst
 -rw-r - r-- 1 oracle dba 0 Jul 21 15:39 d.lst
 -rw-r - r-- 1 oracle dba 7 Jul 21 15:39 e.lst
 -rw-r - r-- 1 oracle dba 14 Jul 21 16:35 f.lst
 
Now he wants to see the size of 7-byte file, use awk to small chopper pilot.
 ll * .lst | awk -v file_size = 7 '{if ($ 5 == file_size) print $ 5 "" $ 9}'
 DUM1102 / oravl01 / oracle> ll * .lst | awk -v file_size = 7 '{if ($ 5 == file_size) print $ 5 "" $ 9}'
 7 e.lst
     
         
       
         
  More:      
 
- C ++ constant definition (Programming)
- FFmpeg compiled with only H264 decoding library (Programming)
- C # compiler to achieve functional use in the runtime (Programming)
- How to install Git client in Ubuntu (Linux)
- Docker Basic Concepts (Linux)
- 64-bit Windows Server 2012 R2 install Oracle 10g Second Edition (Database)
- Sturdy build secure Linux server (Linux)
- Magical Virtualbox under Ubuntu (Linux)
- Command filter MySQL slow query log (Database)
- To install Xen in Ubuntu 12.04 (Linux)
- Java regular expression syntax (Programming)
- What Java 8 fastest garbage collector (Programming)
- MySQL Authorized a recovered (Database)
- Using RAID in Linux: Create a RAID 5 (Linux)
- MySQL server after an unexpected power outage can not start (Database)
- Linux Getting Started tutorial: Experience VirtualBox Virtual Machine chapter (Linux)
- Python basis: os module on the file / directory using methods commonly used functions (Programming)
- Ubuntu rights management common commands (Linux)
- Ubuntu update bug fixes Daquan (Linux)
- Java object initialization (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.