Link to home
Start Free TrialLog in
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> ???
Avatar of sunnycoder
sunnycoder
Flag of India image

Hi integrosys,

ls -1 | wc -l

Cheers!
sunnycoder
Avatar of integrosys
integrosys

ASKER

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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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