Help us understand the problem. What is going on with this article?

ファイルを任意サイズで切り出す

More than 5 years have passed since last update.

バイト数指定すると割と早く処理できる。
バイト数は、less で検索して=で表示される結果で調べてる。
tailで+指定は推奨されないとか書いてあるけど便利。

先頭から指定したSバイト数だけ切り出す

普通の使い方だこれ。-nで行数指定の方が簡単。

$ head -c S ファイル名 > 切り出し先ファイル名

先頭から指定したSバイト目以降を切り出す

$ tail -c +S ファイル名 > 切り出し先ファイル名

先頭からSバイト目以降、Nバイトを切り出す

$ tail -c +S ファイル名 | head -c N > 切り出し先ファイル名

参考

tail - cat line X to line Y on a huge file - Unix & Linux Stack Exchange

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
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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