How to get the number of files in a folder as a variable?

前端 未结 10 1411
粉色の甜心
粉色の甜心 2020-12-28 13:21

Using bash, how can one get the number of files in a folder, excluding directories from a shell script without the interpreter complaining?

With the help of a friend

10条回答
  •  醉酒成梦
    2020-12-28 14:13

    Get rid of the quotes. The shell is treating them like one file, so it's looking for "ls -l".

提交回复
热议问题