Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux filtration empty file command summary     - LVM mirrored logical volume to achieve (Linux)

- How to recover deleted files in Linux systems (Linux)

- ElasticSearch basic usage and cluster structures (Server)

- RedHat Linux 6 desktop installation (Linux)

- LVM management reduces swap partition space to the root partition (Linux)

- CV: Linux command displays the progress of the run command (Linux)

- Modern Objective-C syntax and new features (Programming)

- Windows7 system using Vagrant to build Linux virtualized development environment (Linux)

- Oracle 12C with multi-column index (Database)

- Oracle conditional select statements and looping statements (Database)

- Linux system with a firewall to prevent the DOS attack (Linux)

- To create a full command line Android Build System (Linux)

- CentOS7 virtual machine starts appear Permission denied (Linux)

- MySQL 5.5 on master-slave copy filter (Database)

- Install Visual Studio Code in Ubuntu (Linux)

- sudo command scenario analysis (Linux)

- Linux System Getting Started Learning: Disable HTTP forwarding wget in (Linux)

- Tmux Getting Start (Linux)

- CentOS7 virtual machine creation failed Solution (Linux)

- B-tree - ideas and implementation of C language code (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:      
 
- How to migrate MySQL to MariaDB under linux (Database)
- Ubuntu 14.10 used ifconfig commands to manage your network configuration (Linux)
- Linux - use chroot command (Linux)
- How to modify the Emacs Major Mode Shortcuts (Linux)
- Ubuntu 13.04 configure MyEclipse 10.7 Environment (Linux)
- Android Touch message passing mechanism analysis (Programming)
- 25 Git Advanced Skills (Linux)
- Configure the Linux kernel and use iptables to do port mapping (Linux)
- ld.so.conf.d profile (Linux)
- How to fix Ubuntu / Mint can not add PPA source of error (Linux)
- The multiplexed signal driving IO (Programming)
- MySQL innodb_table_stats table does not exist solution (Database)
- Shell Scripting Basics (Linux)
- OpenGL Superb Learning Notes - Vertex Shader example (Programming)
- Java Adapter Mode (Programming)
- sudo command scenario analysis (Linux)
- Linux Basics Tutorial: Combining awk delete data before the specified date hdfs (Linux)
- RHEL5.x RHEL6.x replace CentOS yum source (Linux)
- CentOS7 install and configure Nagios (Server)
- DVD production using CentOS installation source within the company Yum (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.