2013-11-25 127 views

回答

2

你需要一個for循環遍歷所需的文件:

for f in *.txt; do # All file ending in '.txt' in the current directory 
    LINECOUNT=$(wc -l < "$f") 
    if [[ $LINECOUNT == 1 ]]; then 
     rm "$f" 
    fi 
done 
相關問題