Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux filtration empty file command summary     - Ubuntu prevent arp attacks (Linux)

- SUSE Firewall Configuration (Linux)

- RedHat virtual machine to install VMware Tools (Linux)

- How to configure MariaDB replication in CentOS Linux (Database)

- CentOS source installation GitLab Chinese Version (Server)

- Linux text processing tool of sed (Linux)

- How to use nmap command in Linux (Linux)

- How to manage Vim plugin (Linux)

- GRUB and Linux system repair (Linux)

- Solaris 10 installation configuration mrtg monitoring system (Linux)

- Linux disk partition, format, mount the directory (Linux)

- Linux command ls (Linux)

- Installation configuration CUDA under Ubuntu 14.04 (Linux)

- Linux command line under HTTP traffic sniffing tool: httpry (Linux)

- C ++ inheritance and derived (induction principle) (Programming)

- Java Adapter Mode (Programming)

- Linux kernel socket protocol stack routing lookup cache mechanism (Linux)

- Linux dd command make U disk boot disk (Linux)

- lack of SWAP space during installation of Oracle (Database)

- Vim useful plugin: EasyGrep (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:      
 
- Ubuntu study notes and related problem solving (Linux)
- Android View event delivery (Programming)
- Node.js installed on Ubuntu Upstream version (Linux)
- Simple configuration shell scripts virtual machine environment experiment (Linux)
- How to understand the difference between synchronous and asynchronous non-blocking blocking (Programming)
- 10 Linux in the passwd command examples (Linux)
- Examples of Exploration Class File (Programming)
- Taught you how to install Ubuntu Linux (Linux)
- Linux System Getting Started Learning: Repair (Linux)
- Linux System Getting Started Learning: Disable HTTP forwarding wget in (Linux)
- Build a super simple "hardware" firewall router (Linux)
- AngularJS notes --- Scope and controller (Programming)
- How to configure chroot environment in Ubuntu 14.04 (Linux)
- Fedora 8 configured Heartbeat (Linux)
- MySQL how to export files with the date format (Database)
- Oracle to start to solve the error ORA-27102 (Database)
- Three binary tree traversal (recursive, non-recursive traversal and Morris) (Programming)
- Understanding the Linux load average on other UNIX-Like systems (Linux)
- Linux network monitoring strategy (Linux)
- Nginx Performance Tuning Guidelines (Server)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.