Monday, October 2, 2017

String matchs for not in the Second File

Try to clean some old files/folders:

sort active.list > active.sort
sort all_dir.list > all_dir.sort

# grep -i -F -x -v -f active.sort all_dir.sort > del_list &

This will find all [ (all_dir.sort) - (active.sort) ] put it into [ del_list ].
Case insensitive.


while read DIR_NAME; do
        echo "Moving $DIR_NAME."
        mv ./$DIR_NAME/   /archive/
done <del_list

No comments:

Post a Comment