- ls -l /projects/ghosttrail | tail -n +2 | sed 's/\s\s*/ /g' | cut -d ' ' -f 3 | sort | uniq -c
actually in my first glance, i think it is complicated, and the true is that i got stopped when i see the third code of the program sed,i have forget waht is the \s meaning,when i figure it out and run each program separately, i understand this sentence.
the first part "ls -l ......" is to list the detailed files information within the specified directory;
the second part "tail -n +2" is to filter the result given from first part command to get result without total number of files;
the third part "sed 's/\s\s*/ /g" is to substitute white spaces with only one space';
the fourth part "cut -d ' ' -f 3" is to get the third filed data;
the fifth part " sort " is to sort result alphabetically;
the final part "uniq -c" is to add the repetition number of every line result;
Learning is cool!