Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux filtration empty file command summary     - How to use the Linux terminal Git commands (Linux)

- PuTTY Xming achieve the X11 forwarding ssh (Server)

- Merge Sort (Programming)

- Using DOS command to change UNIX administrator password (Linux)

- Configuring VMWare FreeBSD9.2 remote debugging kernel source code (Linux)

- ASP.NET 5 (vNext) Linux deployment (Server)

- CentOS 5.11 Open VNC access (Linux)

- Ubuntu Linux use MAC binding against ARP attacks (Linux)

- Samba public folder permissions (Server)

- MySQL completely uninstall and install Configuring Character Sets under Linux (Database)

- Build ftp server under CentOS 6.5 (Server)

- Ubuntu user use PPA to install Uget 2.0.5 (Linux)

- C ++ Supplements - Smart Pointers (Programming)

- Ubuntu 12.04 installation DHCP Server (Server)

- When should I use Angular 2 (Programming)

- Several start-up mode of Tomcat (Server)

- OpenVPN offsite interconnecting room availability and load balancing solution (Server)

- Java JDK has been able to compile without warning (Programming)

- Docker: Mirroring and container operations (Server)

- Python objects (Programming)

 
         
  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:      
 
- MySQL is configured to access external networks under Ubuntu (Database)
- To read the Linux ext3 / ext4 format partitions under Windows system software (Linux)
- Tomcat session clustering and server session (Server)
- Linux System shutdown procedures (Linux)
- Linux systems use logwatch log file monitoring (Linux)
- Advanced permissions Linux file system settings (Linux)
- Modifying the system registry protection server security (Linux)
- Oracle capability i / o (stress test database server i / o performance) (Database)
- Calculate CPU utilization (Linux)
- Linux ls command (Linux)
- Linux disk management practices (Linux)
- C language header file defines a global variable (Programming)
- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)
- Setting Hibernate connection MySQL database connection pool coding (Database)
- The virtual memory (Linux)
- Getting Started with Linux system to learn: how to get the process ID (PID) in the script (Linux)
- Linux environment variable settings methods and differences (Linux)
- HAProxy performance under high concurrency (Server)
- Use DB2 federated access Oracle (Database)
- Vagrant Getting Start (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.