#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    25
    Rep Power
    0

    Splitting big files


    Can anyone tell me a simple way to split big files in linux?

    I have an access log that is over 1 Gig in size and I want to split it into a 700meg chunk (that I can burn to a CD) and whatever is left over I'll leave as the access log.

    I really don't think I want to try this with vi ;-)

    --- Cerbere
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    try "man split":

    split -b700m access_log access.part.

    should work
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    25
    Rep Power
    0
    Thanks M.Hirsch,

    That's exactly what I was looking for.

    I was just about to start playing with the dd command.

    --- Cerbere
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    dd can do the same job too.

    you could do:

    dd if=access_log of=acces.part.01 bs=1024k count=700 skip=0
    dd if=access_log of=acces.part.02 bs=1024k count=700 skip=700
    dd if=access_log of=acces.part.03 bs=1024k count=700 skip=1400
    ...
    ... i.e. put it inside a for-loop ....

    (untested, maybe the syntax slightly differs)

    but now that we have "split", why?

    Grüsse,
    M.Hirsch

IMN logo majestic logo threadwatch logo seochat tools logo