+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Full Member level 2
    Points: 2,013, Level: 10

    Join Date
    Apr 2007
    Location
    Gainesville, Florida
    Posts
    136
    Helped
    11 / 11
    Points
    2,013
    Level
    10

    using rm to remove multiple types of files

    Hi All,

    I put this line in my .cshrc

    alias rmlog "find 'pwd' -name '*.log' -print -exec rm -f {} \;"

    question is how do i add *.txt or *.fileextension for that matter?

    Thanks,
    Al

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 4,234, Level: 15

    Join Date
    Aug 2010
    Location
    San Jose area
    Posts
    701
    Helped
    197 / 197
    Points
    4,234
    Level
    15

    Re: using rm to remove multiple types of files

    rm `find . -name "*" -print | egrep '(\.txt$|\.log$)' `



--[[ ]]--