head

J

j

I've lost the head command on my win XP laptop, I think it was never
there.

Suggestions for viewing the Content-type and other header data?

Jeff
 
B

Brian Cryer

j said:
I've lost the head command on my win XP laptop, I think it was never
there.

There isn't a head command provided within Widows. Given you mentioned that
you'd just lost the "head" command, it does imply that you used to have a
head utility which did this for you. I'm not aware of one, but if there is
then I'd hope that someone else will post back.
Suggestions for viewing the Content-type and other header data?

Its not quite the same but "more <filename>" will give you a page worth of
the file contents - but unlike head which just gives you "n" lines more will
give you a page worth at a time, so you will need to control-C if you don't
want to see all of the file.

You mentioned content-type and other header-data, I don't know about the
unix "head" command but I don't think there is any way of connecting "more"
up to a server. If you want to view header and content-type information then
you could try CryPing (free on my site
http://www.cryer.co.uk/downloads/cryping/ ).

For example:

C:\>cryping -v -n 1 -http www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.6 (build June 2010)
Pinging www.cryer.co.uk for HTTP status:

Reply from www.cryer.co.uk: 200 OK time=376ms
HTTP/1.1 200 OK
Date: Tue, 26 Jul 2011 09:03:58 GMT
Server: Apache
Last-Modified: Sat, 16 Jul 2011 09:00:50 GMT
ETag: "5590677-20d8-4a82c00a9d480"
Accept-Ranges: bytes
Content-Length: 8408
Connection: close
Content-Type: text/html

HTTP ping statistics for www.cryer.co.uk:
Requests: Sent = 1, Responses = 1, Lost = 0 (0% loss).
200 OK 1 times (100%)
Approximate round trip times:
Minimum = 376ms, Maximum = 376ms, Average = 376ms

It might be overkill for what you want, but with the "-v" (verbose) flag it
does show headers received back from the server, as shown above.

Hope this helps.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed "Brian Cryer"
If you want to view header and content-type information then
you could try CryPing (free on my site
http://www.cryer.co.uk/downloads/cryping/ ).

Brian, that's one great tool. I've been trying to figure out why one
certain website of mine was not responding in the browser, although it
does respond to a ping and a tracert. Now, I can see that I can see HTTP
is failing, I can report the problem to the host with more information.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Adrienne Boswell
Brian, that's one great tool. I've been trying to figure out why one
certain website of mine was not responding in the browser, although it
does respond to a ping and a tracert. Now, I can see that I can see
HTTP is failing, I can report the problem to the host with more
information.

And wouldn't you know it, just as I was about to send off a trouble
report, the site came back with flying colors!
 
D

Denis McMahon

Gazing into my crystal ball I observed Adrienne Boswell

And wouldn't you know it, just as I was about to send off a trouble
report, the site came back with flying colors!

I like wget -v --save-headers:

$ wget -v --save-headers www.example.com
--2011-07-27 04:19:24-- http://www.example.com/
Resolving www.example.com... 2001:500:88:200::10, 192.0.43.10
Connecting to www.example.com|2001:500:88:200::10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.iana.org/domains/example/ [following]
--2011-07-27 04:19:25-- http://www.iana.org/domains/example/
Resolving www.iana.org... 2620:0:2d0:200::8, 192.0.32.8
Connecting to www.iana.org|2620:0:2d0:200::8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html.3'

[ <=> ] 2,945 --.-K/s in 0s

2011-07-27 04:19:25 (51.3 MB/s) - `index.html.3' saved [2945]

$ head index.html.3
HTTP/1.1 200 OK
Date: Wed, 27 Jul 2011 03:19:25 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Wed, 09 Feb 2011 17:13:15 GMT
Connection: close
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
$

Should work for linux and windows, gives a lot of control over what is
sent (headers, cookies, post data etc).

Rgds

Denis McMahon
 
B

Brian Cryer

Adrienne Boswell said:
Gazing into my crystal ball I observed Adrienne Boswell


And wouldn't you know it, just as I was about to send off a trouble
report, the site came back with flying colors!

That's often the way. The hosts I use are very reliable, but the shared
hosting I use seems to go off-line briefly every few weeks - I've learnt
that its better to wait a little and see instead of raising a ticket (which
would then take them hours to respond to).

Glad you like the tool.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,272
Latest member
MaricruzDu

Latest Threads

Top