Rami J. Allam
Rami J. Allam

Reputation: 19

Shell script searching for regular files

I need a shell script to look for regular files in a directory given as argument and count them in order to display their number.

Upvotes: 0

Views: 66

Answers (2)

Rndp13
Rndp13

Reputation: 1122

#! /bin/ksh

cd $1
list=`ls -l | grep -v '^d' | wc -l`
echo $list

Upvotes: 1

rezdm
rezdm

Reputation: 165

find /some/path -name "aaa.*" | wc -l

Upvotes: 2

Related Questions