Get a count of files/folder in a directory

$ ls -A1 /path/to/folder | wc -l

Lists out the files in a directory including hidden files in a single-column format and pipes it through a line count via wc.

Post new comment

  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.
Comment