Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux cut Command Study Notes     - Lenovo Ultrabooks Ubuntu system can not open the wireless hardware switch solutions (Linux)

- Ubuntu system grub repair method (Linux)

- NIC configuration parameters under Linux (Linux)

- The OpenGL ES GLFW window structures (Programming)

- Sublime Text 3 practical functions and shortcut keys used to collect (Linux)

- How Mutt mail client to use cipher text password (Linux)

- See Linux kernel, CPU, memory, and various versions of the command module and means (Linux)

- Linux system on how to use rsync to synchronize data (Server)

- Linux - Common process the command (Linux)

- Disk storage structure and file recovery experiment (FAT file system) (Linux)

- grep command output highlighted word (Linux)

- Linux System Getting Started Learning: Linux command in w (Linux)

- Usage sed some of the parameters (Linux)

- Use Aptik Battery Monitor monitoring Ubuntu laptop battery usage (Linux)

- Binding unofficial Google Drive and Ubuntu 14.04 LTS (Linux)

- SSH mutual trust configuration (Server)

- C ++ type conversion and RTTI (Programming)

- GitHub multiplayer co-development configuration (Linux)

- Python Basics: Search Path (Programming)

- numpy and SciPy installation under Python for scientific computing package (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:      
 
- Linux install Samba file sharing server (Server)
- MySQL stored procedures and triggers (Database)
- KVM usb passthrough configuration (Linux)
- Help you make Git Bisect (Linux)
- Neo4j map data processing tab (Database)
- Python when automated operation and maintenance often used method (Programming)
- Linux basic introductory tutorial ---- regex basis (Linux)
- Spring Data study notes -Helloworld (Programming)
- httpd-2.4 feature (Server)
- BGP routers want to play it by CentOS (Linux)
- Nmcli based network management command-line tool (Linux)
- Switching Virtual Machine + Ubuntu graphical interface and terminal interface (Linux)
- How Datadog monitor Nginx (Server)
- Detailed driver compiled into the Linux kernel (Programming)
- How to avoid two Chrome icon appears in ELementary OS Freya (Linux)
- Linux data redirection (Linux)
- How to install Gnome 3.10 in Ubuntu 13.10 (Linux)
- GAMIT baseline solution using batch were counted (Linux)
- Dialogue UNIX:! $ # @ *% (Linux)
- RealVNC Server 5.2.3 Installation and Configuration In Fedora (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.