viewing large files (1gig >)

Discussion in 'Site & Server Administration' started by ndreamer, Nov 25, 2007.

  1. #1
    does any know how to view a few lines of a large file in linux, the files are no smaller then 1G.

    is there any way to just chop the first few hundred lines from the file to view that ? other then using split.
     
    ndreamer, Nov 25, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    head -n <number> <filename> , this will view the <number> of lines from the top of the file <filename>
    tail -n <number> <filename> , this will view the last <number> lines of the file <filename>
     
    powerspike, Nov 25, 2007 IP
    ndreamer likes this.
  3. ndreamer

    ndreamer Guest

    Messages:
    339
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks powerspike!
     
    ndreamer, Nov 25, 2007 IP
  4. WL_Marketing

    WL_Marketing Banned

    Messages:
    216
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Don't forget if you want to view line x to line y, you can do:
    head -n y <filename> | tail -n x
     
    WL_Marketing, Nov 27, 2007 IP
  5. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no worries at all, glad it helped =)
     
    powerspike, Nov 27, 2007 IP