Easy!
If you want to check individual files, take a look at "wget --spider" or "curl -I"
(Just in case you don't already know, you can get a list of options for most commands with the 'man' command. Example: man curl )
Here's an example using curl to see if the google logo exists:
## Example where the file exists
# curl -I http://www.google.com/images/srpr/logo3w.png
HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 7007
Last-Modified: Fri, 05 Aug 2011 02:40:26 GMT
Date: Sat, 10 Mar 2012 17:41:50 GMT
Expires: Sat, 10 Mar 2012 17:41:50 GMT
Cache-Control: private, max-age=31536000
X-Content-Type-Options: nosniff
Server: sffe
X-XSS-Protection: 1; mode=block
## Example where the file does NOT exist
# curl -I http://www.google.com/images/srpr/logo3wx.png
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Sat, 10 Mar 2012 17:46:56 GMT
Server: sffe
Content-Length: 954
X-XSS-Protection: 1; mode=block
It gives you the type of file, modification times, etc. without actually downloading the file.
Here's a wget example. The output is much simpler. It just tells you if it exists:
## File exists (200 OK)
# wget -nv --spider http://www.google.com/images/srpr/logo3w.png
2012-03-10 11:45:44 URL: http://www.google.com/images/srpr/logo3w.png 200 OK
## File does NOT exist
# wget -nv --spider http://www.google.com/images/srpr/logo3wx.png http://www.google.com/images/srpr/logo3wx.png:
Remote file does not exist -- broken link!!!
If you want to read the contents of an entire directory, you can do that only if that directory allows 'directory listing'. If you can browse to that directory in a web browser and see a list of files, then it's good!
Here's an example using the directory listing of ibiblio's pub/linux archive to see if 'robots.txt' exists:
# wget -qO- http://distro.ibiblio.org/pub/linux/distributions/ | grep robots
<tr><td class="n"><a href="robots.txt">robots.txt</a></td><td class="m">2011-May-05 19:14:55</td><td class="s">0K </td><td class="t">text/plain</td></tr>
You can parse that output however you want to find what you need.
If your web server does NOT allow directory listing, or there is an index.html(.php, .htm, etc.) in place, then you will have to check for each file individually, using something like the first example.
I hope this helps!