Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux cut Command Study Notes     - Linux processes in memory and memory cgroup statistics (Linux)

- How to cool down your Ubuntu system (Linux)

- Use HttpClient remote interface testing (Programming)

- Python when automated operation and maintenance often used method (Programming)

- Oracle Client Dedicated and Shared connection mode (Database)

- Linux file content inspection - cat, tac, no, more, less, head, tail, od (Linux)

- mysqldump issue a note (Database)

- Java rewrite equals method (Programming)

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

- rsync server set up (Server)

- Oracle ordinary users show parameter method (Database)

- Git Advanced Tutorial (Linux)

- Ubucompilator-Ubuntu, Debian, Linux Mint created deb package of graphical tools (Linux)

- The FreeBSD zfs: failed with error 6 Error Resolution (Linux)

- Android Studio and Git Git configuration file status (Linux)

- Oracle users to automatically increase the partition table (Database)

- Ubuntu system grub repair method (Linux)

- Linux screen commonly commands (Linux)

- Linux how to prohibit the use of Ping command (Linux)

- Linux operating system, the internal and external security overview (Linux)

 
         
  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:      
 
- CentOS modify yum update source (Linux)
- Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 in (Linux)
- Linux Network Programming --epoll model Detailed principles and examples (Programming)
- MySQL master-slave delay problem (Database)
- Ubuntu 14.10 / 14.04 / 12.04 How to install Kodi 14.0 RC3 (Linux)
- How to install the Linux text editor Atom 0.124.0 (Linux)
- VirtualBox modify the size of the virtual machine disk VDI (Linux)
- Method under Linux GCC Compiler shared library function export control (Programming)
- LaTeX Getting Started Tutorial (Linux)
- How to view the Linux program or process used in the library (Linux)
- Linux environment variable configuration and save places (Linux)
- Setting CentOS firewall open port (Linux)
- C ++ Supplements - locates the new expression (Programming)
- Oracle online redefinition (Database)
- MySQL Authorized a recovered (Database)
- Oracle bdump file soaring (Database)
- CentOS7 virtual machine creation failed Solution (Linux)
- Three details reflect the Unix system security (Linux)
- The most commonly used Linux commands (Linux)
- IPTABLES configuration steps under Linux (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.