Friday, May 3, 2024
97
rated 0 times [  97] [ 0]  / answers: 1 / hits: 127087  / 3 Years ago, sat, october 23, 2021, 9:06:43

Simple question I'm sure. I've seen an answer that show how to do it including subdirectories, but I want to know how many files (not folders) are in the current directory only. Thanks.


More From » command-line

 Answers
0
ls -F |grep -v / | wc -l



  1. ls -F list all files and append indicator (one of */=>@|) to
    entries

  2. grep -v / keep all de strings that do not contain a
    slash

  3. wc -l count lines


[#28580] Monday, October 25, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;