Operating System - HP-UX
1762905 Members
2148 Online
108909 Solutions
New Discussion юеВ

Re: how to find the total number of files available in one particular directory

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

how to find the total number of files available in one particular directory

Hi All,

There is one directore /orders in my hpux server.

This directory contains lot files and subdirectories.

What is the command is used to find the total number of files available under that directory and its directories
4 REPLIES 4
Tim Nelson
Honored Contributor
Solution

Re: how to find the total number of files available in one particular directory

define "available" ?

find /orders -type f |wc -l

Patrick Wallek
Honored Contributor

Re: how to find the total number of files available in one particular directory

cd /orders
find . -type f | wc -l

The number that is returned is the total number of files in all sub-directories under /orders.
Kranti Mahmud
Honored Contributor

Re: how to find the total number of files available in one particular directory

Hi Senthil,

As they said:

cd /orders
find . -type f | wc -l

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Suraj K Sankari
Honored Contributor

Re: how to find the total number of files available in one particular directory

Hi Senthil,

You can do it in this way also
$ cd /tmp
$ ls -lrt | grep -v ^d | wc -l
1861

It will not go inside of any other directiory in /tmp.

Suraj