Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] deleting a local list of filenames from remote server



2008/12/2 Charles Muller <cmuller-lst@example.com>:
> ssh user@example.com 'xargs rm < filelist public_html/cache/'
>
> I know that this is not close at all

Not far off: something like:

(cd local_path/ ; ls) | ssh user@example.com '(cd remote_path/; xargs rm)'

You run the risk of unexpected things happening if you ever have
spaces, leading hyphens, etc., in filenames, but otherwise you should
be OK.

The 'ls' could instead be 'find -type f -newer ... -print' if it's in
a nested structure.  find has lots of time-based options and I don't
claim to have picked the best one or even one that exists ;-)


HTH,
-- 
Ian.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links