[SATLUG] Deleting files

Brinkley Harrell jbharrell at fusemeister.com
Thu Dec 24 06:42:17 CST 2009


Try something like:

cd {root of the maps dir}
find . -type f -name "*shp" -print | grep -v pointlm | grep -v 
tabblock00 | grep -v vid00 | xargs rm -f

That should do it. Maybe make a practice directory to experiment on. The 
'rm' command is very unforgiving.

Merry Christmas and safe, Happy Holidays to you and everyone.

Brinkley.



Geoff wrote:
> First off, Merry Christmas, everyone.  Safe holiday travels, if you
> intend to do so.
>
> 2nd, I'm a Ham Radio operator.  I've recently gotten active in APRS
> (Automatic Position Reporting System) via ham radio.
>
> Xastir (as far as I can tell) is the only Native Linux APRS
> client/tracking software package available.
>
> I found a whole BUNCH of maps, but after lots of research and
> conversation with other hams, I'm finding that there are -many- files
> that are simply redundant and more than that, they're not necessary.
>
> The directory structure of the maps is broken down by states, and
> counties for each state.
>
> all directories contain .shp files (shape). 
>
> linux:/usr/share/xastir/maps/TIGER2008/48_TEXAS # ls *.shp
> tl_2008_48_bg00.shp      tl_2008_48_cousub.shp   
> tl_2008_48_placeec.shp  tl_2008_48_tabblock.shp
> tl_2008_48_cd108.shp     tl_2008_48_cousub00.shp 
> tl_2008_48_puma100.shp  tl_2008_48_tabblock00.shp
> tl_2008_48_cd110.shp     tl_2008_48_elsd.shp     
> tl_2008_48_puma500.shp  tl_2008_48_tract00.shp
> tl_2008_48_county.shp    tl_2008_48_elsd00.shp   
> tl_2008_48_scsd.shp     tl_2008_48_unsd.shp
> tl_2008_48_county00.shp  tl_2008_48_place.shp    
> tl_2008_48_sldl.shp     tl_2008_48_unsd00.shp
> tl_2008_48_countyec.shp  tl_2008_48_place00.shp   tl_2008_48_sldu.shp
>
> All I need are
> pointlm
> tabblock00
> and
> vtd00
>
> The question is:
> How do I go to the root of the maps dir, and tell it
> rm -r *.shp except pointlm, tabblock00, vid00
>
> is it that easy?  rm --help wasn't that helpful.
> Man rm didn't answer my questions, either.
>
> Thanks!
> -Geoff
>
>
>
>   

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brinkley Harrell
http://www.fusemeister.com



More information about the SATLUG mailing list