Tukubaiオンラインコマンドマニュアル

ctail(1)

【名前】

ctail : ファイルの末尾n行を削って出力

【書式】

Usage   : ctail -n <file>
        : ctail n <file>
        : ctail -<n>c <file>
Version : Thu Dec 15 13:46:38 JST 2011
UTF-8

【説明】

引数のファイルまたは標準入力のテキストデータから、引数-n(またはn)で指定した行数
の末尾行を除いて標準出力に出力する。

【例】ファイルの末尾3行を削って表示する。

$ cat data
001 北海道
002 東北
003 関東
004 中部
005 近畿
006 中部
007 四国
008 九州
009 沖縄
$

$ ctail -3 data > data2
$ cat data2
001 北海道
002 東北
003 関東
004 中部
005 近畿
006 中部
$

【例2】ファイルの末尾nバイトを削る

$ echo -n abcde | ctail -1c
abcd
$

$ echo -n abcde | ctail -2c
abc
$

【関連項目】

getfirst(1)、getlast(1)、tcat(1)、ycat(1)

last modified: 2014-01-13 16:01:13
Contact us: uecinfo@usp-lab.com
Copyright (c) 2012-2014 Universal Shell Programming Laboratory All Rights
