script help

RGH rgheck at comcast.net
Mon Dec 1 21:10:50 UTC 2008


adrian kok wrote:
> Hi
>
> I have script to remove files but it can't work in
> directory
>
>
> ls *log | sort -r | sed -e 1,1d | xargs rm -f
>
> those folders are:
>
> Nov28-log
> Nov29-log
> Nov30-log
>
>   

The problem is that you're getting things like "Nov28-log:" back, with
the trailing colon. Try this:
    ls -1d *log | xargs rm -Rf
Note that the first option is a one, not an el.

rh





More information about the fedora-list mailing list