[CentOS] wget and resulting filenames with mirror option

Wed Jul 28 20:44:59 UTC 2010
Todd Denniston <Todd.Denniston at tsb.cranrdte.navy.mil>

Joseph L. Casale wrote, On 07/28/2010 04:26 PM:
> I am trying to mirror a directory using wget and the resulting files as
> expected are taking the name of the string in the url after the last "/".
> 
> Anyone know a way around this? I am using the mirror option so I don't
> have to keep track of what to get making it simple.
> 
> Thanks!
> jlc

I am having a bit of trouble parsing what you wrote, but I think you are saying you are issuing
something like:
wget --mirror http://example.com/subdir1/subdir2/fileiwant
and getting at your location
./fileiwant
which is a little confusing, because I would have expected you to get (with just the --mirror option):
./example.com/subdir1/subdir2/fileiwant

please give an example command and output received and desired.

to get ./fileiwant from my example url above I think you would have to do:
wget --mirror ---cut-dirs=2 -no-host-directories \
	http://example.com/subdir1/subdir2/fileiwant

-- 
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter