Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux cut Command Study Notes     - After Pydev installation, Eclipse does not display solutions (Linux)

- Oracle 11g RMAN cross-platform transfer table space (Database)

- To install PostgreSQL 9.4 (Database)

- Node.js development environment deployment (Server)

- To install Docker under CentOS7 (Linux)

- Linux desktop system using the remote server in clear text ssh password (Server)

- High-performance JavaScript loaded and executed (Programming)

- Oracle 11g 10g induced into error (Database)

- Ubuntu update bug fixes Daquan (Linux)

- Simple RPM package production (Linux)

- Linux System Getting Started Learning: Disable Ubuntu Apport internal error reporting procedures (Linux)

- MySQL management partition table (Database)

- iostat command Detailed (Linux)

- Linux system firewall defense network attacks (Linux)

- Linux under HAProxy + Keepalived dual-availability program (Server)

- Upgrading to MySQL 5.7 partitioning problem solving (Database)

- User rights management system under Linux (Linux)

- Linux System Getting Started Learning: From VirtualBox from the client host access NAT (Linux)

- How to Check notebook CPU temperature in Ubuntu (Linux)

- According to the national position on how to block traffic in Linux (Server)

 
         
  Linux cut Command Study Notes
     
  Add Date : 2018-11-21      
         
       
         
  Cut command is one of the most commonly used commands Linux.

As its name suggests, cut job is to "cut", specifically, is in charge of cutting data in a file. cut each act is a processing target, and sed this mechanism is the same.

Cut cut metric command in three ways:

Byte Cut: -b (byte)
Cut by character: -c (character)
By Shear: -f (field) to specify the time domain by shear delimiter, the default delimiter is a tab (\ t).
 

In addition, cut command also supports a range of digital representation,

      N N'th byte, character or field, counted from 1

      N- from N'th byte, character or field, to end of line

      N-M from N'th to M'th (included) byte, character or field

      -M From first to M'th (included) byte, character or field


Examples given to illustrate:

Cut in bytes
date | cut -b 1-5
2014
date | cut -b 1-6
2014
date | cut -b 1-7
Year 2014

As can be seen from the above example the Chinese character "years" accounted for 3 bytes

In accordance with the character cut

date
October 10, 2014 Friday 14:48:16 CST
date | cut -c 1,3,4
214

Positioning a plurality of separated by commas

In accordance with Shear

date
October 10, 2014 Friday 14:46:09 CST
date | cut -d "" -f 4,5
Friday 14:46:12

-d delimiter and indicates delimiter must be a single character.
     
         
       
         
  More:      
 
- Install Mac OS X 10.9 systems VMware10 (Linux)
- Detailed LVM2 (Linux)
- Oracle to create an external table (Database)
- Git Installation and Configuration (Network Agent settings) (Linux)
- Ubuntu 14.10 / 14.04 how to install Quick Start tool Mutate 2.2 (Linux)
- To install and use Docker under linux (Server)
- Java-based data source database access (Programming)
- How to fix the Ubuntu Error script returned error exit status 1 (Linux)
- Linux learning portal: CentOS 6.4 system kernel upgrade (Linux)
- Efficient running Linux virtual machine Six Tips (Linux)
- DataGuard a hardware issue warnings found (Database)
- Zabbix API and PHP configuration (Server)
- The most concise explanation of JavaScript closures (Programming)
- Timing task Crontab under Linux system (Linux)
- Help you make Git Bisect (Linux)
- The Zabbix2.4.5 source compiler installation under Ubuntu 14.04 (Server)
- C language keywords Comments (Programming)
- Linux system started to learn: the Linux syslog (Linux)
- How to fix apt-get update can not add a new CD-ROM error (Linux)
- Linux FAQ - How to fix tar:Exitingwith failure status due to previous errors (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.