Monday, June 21, 2010

Count the number of files in a directory in Solaris.

Command: ls -1 | wc -l
note, the first '-l' is numeric '1' while the latter is an alphabet lower-cased "L".

Example:
bash-2.03$ ls -1 | wc -l
      24

No comments: