Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I want to split a file which has a size of 4.5Gb . But the problem is I have 2 Gb of space remaining. split command keeps the original ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    5

    Lightbulb Splitting of file?


    Hi,

    I want to split a file which has a size of 4.5Gb . But the problem is I have 2 Gb of space remaining. split command keeps the original file also. So thats out of question. If i try to open the file in vi it gives me some write error. So copying from vi is also not an option. So is there a way to copy specific no. of lines and delete specific no. of lines???

  2. #2
    Just Joined! sharik_pahwa's Avatar
    Join Date
    Jun 2007
    Posts
    29
    U CAN TRY VIA TAIL COMMAND.

    like for last 300 lines
    #tail -300 filename > newfile

    else can explore more of tail (-c for size in bytes)

    redirect output to new file and delete the original one.

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    5

    Red face

    I know about use of tail -n and to redirect specific no. of lines to file.
    But the problem still remains how to delete those lines which are copied without using vi?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •