Cut Command

download Cut Command

of 21

Transcript of Cut Command

  • 8/2/2019 Cut Command

    1/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Presentation

    on

    Cut Command

    Sneha Agarwal

    11030142017

    Symbiosis Institute of Computer Studies & Research

    September 22, 2011

    Sneha Agarwal 11030142017 Presentation on Cut Command

    http://find/http://goback/
  • 8/2/2019 Cut Command

    2/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Introduction of Cut Command...

    Sneha Agarwal 11030142017 Presentation on Cut Command

    http://goforward/http://find/
  • 8/2/2019 Cut Command

    3/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Introduction of Cut Command...

    Use

    A Cut command is used to remove sections from each line offiles.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    http://find/
  • 8/2/2019 Cut Command

    4/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Introduction of Cut Command...

    Use

    A Cut command is used to remove sections from each line offiles.

    Basic WokingThe cut command takes a vertical slice of a file, printing onlythe specified columns or fields.Its easiest to think of a column

    as just the nth character on each line.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    http://find/
  • 8/2/2019 Cut Command

    5/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Introduction of Cut Command...

    Use

    A Cut command is used to remove sections from each line offiles.

    Basic WokingThe cut command takes a vertical slice of a file, printing onlythe specified columns or fields.Its easiest to think of a column

    as just the nth character on each line.

    In Short

    Column 5 consists of the fifth character of each line.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    P i Li C d I d i

    http://find/
  • 8/2/2019 Cut Command

    6/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Basic Syntax And Option...

    Sneha Agarwal 11030142017 Presentation on Cut Command

    P t ti Li C d I t d ti

    http://find/
  • 8/2/2019 Cut Command

    7/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Basic Syntax And Option...

    Syntax

    cut OPTION...[FILE]...

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    8/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Basic Syntax And Option...

    Syntax

    cut OPTION...[FILE]...

    Option

    -b -bytes=LIST

    select only these bytes.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    9/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Basic Syntax And Option...

    Syntax

    cut OPTION...[FILE]...

    Option

    -b -bytes=LIST

    select only these bytes.

    -c characters=LIST

    select only these characters.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    10/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Basic Syntax And Option...

    Syntax

    cut OPTION...[FILE]...

    Option

    -b -bytes=LIST

    select only these bytes.

    -c characters=LIST

    select only these characters.

    -d delimiter=DELIMuse DELIM instead of TAB for field delimiter.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://goforward/http://find/http://goback/
  • 8/2/2019 Cut Command

    11/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Options Continued

    Option

    -f fields=LISTselect only these fields; also print any line that contains nodelimiter character, unless the -s option is specified.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/
  • 8/2/2019 Cut Command

    12/21

    Presentation on Linux Command

    Cut Command

    Thank You

    Introduction

    Syntax

    Example

    Options Continued

    Option

    -f fields=LISTselect only these fields; also print any line that contains nodelimiter character, unless the -s option is specified.

    -s only-delimited

    do not print lines not containing delimiters

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    13/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    14/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 1 :

    $ cut -c 1-3 file

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    15/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 1 :

    $ cut -c 1-3 fileThe above command prints the first three columns of each line

    of the file.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command Introduction

    http://find/http://goback/
  • 8/2/2019 Cut Command

    16/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 1 :

    $ cut -c 1-3 fileThe above command prints the first three columns of each line

    of the file.

    example 2 :

    $cut -d: -f2 file

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux Command

    C C d

    Introduction

    S

    http://find/http://goback/
  • 8/2/2019 Cut Command

    17/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 1 :

    $ cut -c 1-3 fileThe above command prints the first three columns of each line

    of the file.

    example 2 :

    $cut -d: -f2 file

    The above command will print the second field of each lineseperated by the delimiter :. It also prints lines that contains nodelimiter character.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux CommandC t C d

    IntroductionS t

    http://find/http://goback/
  • 8/2/2019 Cut Command

    18/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux CommandCut Command

    IntroductionSyntax

    http://find/http://goback/
  • 8/2/2019 Cut Command

    19/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 3 :

    $cut -d: -f1,3 -s file

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux CommandCut Command

    IntroductionSyntax

    http://find/http://goback/
  • 8/2/2019 Cut Command

    20/21

    Cut Command

    Thank You

    Syntax

    Example

    Examples...

    example 3 :

    $cut -d: -f1,3 -s fileThe above command will print the first and third field of each

    line seperated by the delimiter :. It will not print lines that

    contains no delimiter character.

    Sneha Agarwal 11030142017 Presentation on Cut Command

    Presentation on Linux CommandCut Command Thank You

    http://find/
  • 8/2/2019 Cut Command

    21/21

    Cut Command

    Thank You

    Thank You

    Thank You...

    Thank You...!!!

    Sneha Agarwal 11030142017 Presentation on Cut Command

    http://find/