Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Lightbulb Splitting of file?


    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

    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

    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?

  4. $spacer_open

Posting Permissions

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