Quantcast
Channel: User Dennis Williamson - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 61

Answer by Dennis Williamson for How can I get a count of files in a directory using the command line?

$
0
0

Here's another technique along the lines of the one Gilles posted:

word_count () { local c=("$@"); echo "${#c[@]}"; }
file_count=$(word_count *)

which creates an array with 13,923 elements (if that's how many files there are).


Viewing all articles
Browse latest Browse all 61

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>