Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
42
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@sugyan

ファイルのn行目以降を表示する

-nオプションに対する値に+を使う

$ cat lines.txt
line_1
line_2
line_3
line_4
line_5
line_6
line_7
line_8
line_9
$ tail -n 3 lines.txt
line_7
line_8
line_9
$ tail -n +3 lines.txt
line_3
line_4
line_5
line_6
line_7
line_8
line_9

-nオプションを省略する使い方は現在のPOSIXバージョンではサポートされていない。_POSIX2_VERSION=199209と環境変数をセットすることで使用できる。

$ tail +3 lines.txt
tail: cannot open `+3' for reading: No such file or directory
$ _POSIX2_VERSION=199209 tail +3 lines.txt
line_3
line_4
line_5
line_6
line_7
line_8
line_9
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
42
Help us understand the problem. What is going on with this article?