I'm trying to delete all the files that do not start with __
. This
ls | grep -v "__" | xargs -0 rm
Yields : File name too long
. Any help?
EDIT:
ls | grep -v "__" | awk '{print("rm \42"$0"\42")}' | /bin/bash
solves the problem, but I'd like to know why the first is not correct. Thanks