it works by printing the number of entities processed - the number of entities that are that are not files (!-f)
Update: fixed thanks to jmcnamara
perl -e'opendir(D,shift)?print((map{$i+=!-f}readdir(D))-$i):die' your_ +dir_here
perl -le'opendir(D,".")?print((map{$i+=!-f}readdir(D))-$i):die'
In reply to number of files in current directory - one liner by particle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |