uspTukubaiコマンドに関する様々な資料がここにあります。

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

ctail(USP)

Name

ctail : Delete the last n rows of a file

Synopsis

Usage   : ctail [-n] [-]<n>[c] <file>.

Version : Tue Jan  9 09:02:34 JST 2024

Edition : 1

Description

Outputs the file specified as the argument or standard input

removing the last <n> lines.

If specified as -<n>c then the last <n> bytes are removed.

The "-n" argument can be omitted.

  ctail -n 3

  ctail -3

  ctail 3

all behave identically.

Example 1

Remove the last 3 lines.

$ cat data

001 Maine

002 Vermont

003 New_York

004 Delaware

005 Georgia

006 Delaware

007 Mississippi

008 Alabama

009 Hawaii

$ ctail -3 data

001 Maine

002 Vermont

003 New_York

004 Delaware

005 Georgia

006 Delaware

Example 2

# Remove last 11 characters ("009 Hawaii<NL>")

$ ctail -11c data

001 Maine

002 Vermont

003 New_York

004 Delaware

005 Georgia

006 Delaware

007 Mississippi

008 Alabama