1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to view html file as a webpage via command line?

Discussion in 'Site & Server Administration' started by postcd, Jan 18, 2016.

  1. #1
    Hello,

    i have mail file named example "1453102828.H684028P24870.host.provider.com,S=32726"
    that file is not proper html formated in it, but have parts which is HTML.
    im looking for the fastest way to view this file as a processed html (as if i view it as .htm file via web browser), but can i do it via command line some easy way?

    im asking this, because the html in that file is really hard to read, too complicated

    so far i coppied it to my webpage folder, changed its ownership and then typed the address in webbrowser. but its too complicated, any command i can do via command line as root?
     
    postcd, Jan 18, 2016 IP
  2. pwhrita

    pwhrita Active Member

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    83
    #2
    You can use 'vi' editor to view the content. Other editor in linux are nano, pico. You can use either of them to view files content.
     
    pwhrita, Jan 18, 2016 IP
  3. postcd

    postcd Well-Known Member

    Messages:
    1,037
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #3
    i dont need to view source code. i thought i already described it.
     
    postcd, Jan 18, 2016 IP
  4. pwhrita

    pwhrita Active Member

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    83
    #4
    Ah..my bad. Try lynx in the command line. Lynx is a fully-featured World Wide Web (WWW) client for users
     
    pwhrita, Jan 18, 2016 IP
  5. postcd

    postcd Well-Known Member

    Messages:
    1,037
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #5
    thx,

    lynx filename did not worked. i have to use:

    lynx -force_html 1453102828.H684028P24870.host.provider.com,S=32726

    this is not easy to remember, but thx alot for help (also in other topics)

    BTW, is there any way to just print output of lynx and quit, instead of keeping lynx open letting me to scroll tru the file?
    //answer: yes, it appears i can use "-dump" switch
     
    Last edited: Jan 18, 2016
    postcd, Jan 18, 2016 IP
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    Create an alias like viewhtml <name of file> which runs lynx with the -force_html and -dump switch?
     
    PoPSiCLe, Jan 18, 2016 IP
  7. postcd

    postcd Well-Known Member

    Messages:
    1,037
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #7
    Thanks,
    # alias viewhtml="lynx -force_html"
    and then i do:
    # viewhtml myfile
    and it works.

    PS: issue with lynx is that it shows non-html parts of file as stucked into one block of text (without breaks)
     
    postcd, Jan 18, 2016 IP
  8. jaguar34

    jaguar34 Notable Member

    Messages:
    1,350
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    215
    #8
    In older version of Windows also we used Webpages in Netscape browser, not much of use for command line except older OS.
     
    jaguar34, Jan 29, 2016 IP