Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Awk include binding capacity larger than the specified size of all files directory     - Xmanager Remote Desktop login CentOS 6.5 (Linux)

- Intrusion prevention network server security maintenance tips (Linux)

- Those things packaged using Gradle to Android (Programming)

- awk variables (Linux)

- Use apt-p2p up a local Debian package cache (Server)

- Linux operating system security management skills notes (Linux)

- cursor_sharing induced error ORA-00600 (Database)

- CentOS 6.5 dual card configuration, one of the external network, a local area network connection (Linux)

- Use Spring cache and ehcache (Programming)

- Java data structures - the single linked list LinkedList linear table (Programming)

- RPM package fabrication method (Linux)

- FileZilla FTP && TLS connection settings of (Linux)

- Report generation CPU, memory, and input and output ports with the sar command (Linux)

- After you change the GRUB boot disk partition repair (Linux)

- How to build a container cluster (Server)

- Create a DLL using MinGW and Attention (Programming)

- Linux Getting Started tutorial: Borrow Windows fonts in Ubuntu 14.10 (Linux)

- View processes and threads under Linux (Linux)

- Android graphic introduction NDK installation and simple jni demo implementation (Linux)

- Oracle 12C modify spfile path (Database)

 
         
  Awk include binding capacity larger than the specified size of all files directory
     
  Add Date : 2016-06-19      
         
         
         
  Business Background

/ Home / pms directory is the working directory, the directory now take up hard disk space is too large, need to be cleaned, and now needs to enumerate all the space in the directory sub-directory is larger than 200MB, and the sub-file directory

Scripts

du -h --max-depth = 10 / home / pms / * | awk '{if ($ 1 ~ / M /) {split ($ 1, arr, "M")}; if (($ 1 ~ / G /) || ($ 1 ~ / M / && arr [1]> 200)) {printf "% -10s% s \ n", $ 1, $ 2}} '| sort -n -r
among them

du -h --max-depth = 10 / home / pms / *
The results are as follows

The following awk statement, is to determine the first parameter, string matching, if it is M, then the interception by character M

if ($ 1 ~ / M /) {split ($ 1, arr, "M")};

$ Du -h --max-depth = 10 / home / pms / *
0 / home / pms / addressCountMap
12K / home / pms / bigDataEngine / conf
1.7M / home / pms / bigDataEngine / analysis / warning
33M / home / pms / bigDataEngine / analysis / log
..

The following awk statement, is to determine the first parameter, string matching:

M, determined that the size is greater than 200MB, is directly output parameter 1 and parameter 2

G, direct output parameter 1 and parameter 2

if (($ 1 ~ / G /) || ($ 1 ~ / M / && arr [1]> 200)) {printf "% -10s% s \ n", $ 1, $ 2}
Output

($ 1 ~ / M / && arr [1]> 200)) {printf "% -10s% s \ n", $ 1, $ 2}} '| sort -n -r
     
         
         
         
  More:      
 
- Linux port scanning (Linux)
- Use matplotlib scientific drawing in Linux (Linux)
- Ubuntu users to install household financial management tools HomeBank 5.0.0 (Linux)
- See Shell Script Linux Server network traffic (Server)
- Eclipse, Tomcat configuration JNDI connection Oracle data source example (Server)
- High-performance JavaScript DOM programming (Programming)
- To install and deploy Java applications under CentOS 6.5 (Linux)
- Linux environment variable settings and save places (Linux)
- Linux based exercises, interview questions (Linux)
- Debian (Wheezy) Install Java environment / replace OpenJDK as the SUN JDK (Linux)
- Install Java on RHEL6 (Linux)
- Make Windows boot disk to install USB in Ubuntu Linux (Linux)
- RAID disk array Description (Linux)
- Deploy Apache Spark cluster environment in Ubuntu (Server)
- MySQL loose index scan (Database)
- Spark build standalone version cluster (Server)
- In-depth summary of the PHP core of object-oriented (Programming)
- By creating a personal technology blog Detailed GitHub (Linux)
- ORA-28000 the account is locked fault simulation (Database)
- The Samba service does not have permission to access (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.