Avatar of integrosys
integrosys
 asked on

Unix command to count number of files in a directory

Could anyone kindly assist, I would need a unix command to list a count of the number of files in a directory.

ls - <which parameter> ???
Unix OS

Avatar of undefined
Last Comment
cohare

8/22/2022 - Mon
sunnycoder

Hi integrosys,

ls -1 | wc -l

Cheers!
sunnycoder
integrosys

ASKER
I need to list the number of files obmitting subdirectories....???
ASKER CERTIFIED SOLUTION
sunnycoder

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
cohare

So i found if i did the following it picks the vLUN's up. Is there an easier way? there has to be a better way than this





# luxadm -e port

Found path to 0 HBA ports

# ls /dev/cfg
c0  c1  c2






Your HBA vLUN connections are  

/pci@1d,700000/QLGC,qlc@2,1   c4

/pci@1d,700000/QLGC,qlc@2   c3



# cd /dev/cfg
# ls -atl
total 70
drwxr-xr-x  15 root     sys        31744 Apr 24 06:43 ..
drwxr-xr-x   2 root     root         512 Apr  9 01:23 .
lrwxrwxrwx   1 root     root          38 Apr  3 02:42 c0 -> ../../devices/pci@1e,600000/ide@d:scsi
lrwxrwxrwx   1 root     root          39 Apr  3 02:42 c1 -> ../../devices/pci@1f,700000/scsi@2:scsi
lrwxrwxrwx   1 root     root          41 Apr  3 02:42 c2 -> ../../devices/pci@1f,700000/scsi@2,1:sc


# cd devices
# ls -al
total 20
drwxr-xr-x   6 root     sys          512 Apr  3 07:35 .
drwxr-xr-x  24 root     root         512 Apr 24 06:41 ..
crw-------   1 root     sys      194,  0 Apr  3 02:42 memory-controller@0,0:mc-us3i
crw-------   1 root     sys      109,  0 Apr  3 02:42 pci@1c,600000:devctl
drwxr-xr-x   6 root     sys          512 Apr  7 07:19 pci@1d,700000
crw-------   1 root     sys      109,  1 Apr  3 02:42 pci@1d,700000:devctl
drwxr-xr-x   4 root     sys          512 Apr  3 02:42 pci@1e,600000
crw-------   1 root     sys      109,  2 Apr  3 02:42 pci@1e,600000:devctl
drwxr-xr-x   3 root     sys          512 Apr  3 02:42 pci@1f,700000
crw-------   1 root     sys      109,  3 Apr  3 02:42 pci@1f,700000:devctl
crw-------   1 root     sys      205,  0 Apr  3 02:42 ppm@1c,0:jbus-ppm
crw-------   1 root     sys      205,  1 Apr  3 02:42 ppm@1e,0:jbus-ppm
drwxr-xr-x   2 root     sys         5120 Apr  4 19:35 pseudo



so add the following

# cd /dev/cfg

ln -s ../../devices/pci@1d,700000/QLGC,qlc@2,1  c4
ln -s ../../devices/pci@1d,700000/QLGC,qlc@2    c3


> reboot -- -r

> devfsadm
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy