command to verify number of files


 
Thread Tools Search this Thread
Operating Systems AIX command to verify number of files
# 1  
Old 02-15-2011
command to verify number of files


Guy's

I have file system called /appspft has millions of files and I want to know exactly how many file under it

Pls advice with that command to verify number of files ..
# 2  
Old 02-15-2011
A quick search brought up this.
# 3  
Old 02-15-2011
Ty using command ls directory name | wc -l it will count the no. files as well no. of directories.

Regards
Ahmed
# 4  
Old 02-15-2011
CPU & Memory find command

you can use the following find command:

Code:
find /appspft/* -print | wc -l

the * is necessary because its prevent from the up directory to be include in the count (see example below)

this will include folder in the count if you want to exclude the you can use the -type in the find command like this:

Code:
find /appspft/* -type f -print

Code:
# find /appspft/* -print | wc -l 
      10

# find /appspft/* -type f -print | wc -l
       7

# find /appspft/* -print
/appspft/appspft1
/appspft/appspft2
/appspft/appspft3
/appspft/appspft4
/appspft/dir1
/appspft/dir1/appspft1
/appspft/dir2
/appspft/dir2/appspft2
/appspft/dir3
/appspft/dir3/appspft3

# find /appspft/* -type f -print
/appspft/appspft1
/appspft/appspft2
/appspft/appspft3
/appspft/appspft4
/appspft/dir1/appspft1
/appspft/dir2/appspft2
/appspft/dir3/appspft3


hope this help.

Last edited by pludi; 02-15-2011 at 10:45 AM.. Reason: added code tags, removed self promotion
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX - command to count number of files in subdirectories

I have a folder named test/ and under that I have multiple directories and in each of the directory I have multiple log files. I want to know how many files exists under each sub directory. test |--quanrantine |--logfile1 |--logfile2 |--spooling |--logfile1 ... (4 Replies)
Discussion started by: ravikirankethe
4 Replies

2. Shell Programming and Scripting

Verify if line number exist

os: linux/sunos i'm running the following: sed -n "2065696{p;q}" /tmp/file.txt /tmp/file.txt is a very big file. it ranges from 400MB to 4GB in size. i want to know if line 2065696 exist. hence the reason for the above. but the problem is, this command is very slow. i have tried awk and... (4 Replies)
Discussion started by: SkySmart
4 Replies

3. UNIX for Dummies Questions & Answers

Command to split the files based on the number of lines in it

Hello Friends, Can anyone help me for the below requirement. I am having a file called Input.txt. My requirement is first check the count that is wc -l input.txt If the result of the wc -l Input.txt is less than 10 then don't split the Input.txt file. Where as if Input.txt >= 10 the split... (12 Replies)
Discussion started by: malaya kumar
12 Replies

4. UNIX for Dummies Questions & Answers

Command for total number of files (and size) across subdirectories?

Hi all... I have a directory called dbrn. This directory contains an unknown number of subdirectories which in turn contain an unknown number of files. What I want to know is: How many files with extention .ABC can be found in /dbrn across all subdirecties, and what is the total size for... (9 Replies)
Discussion started by: Beun
9 Replies

5. AIX

verify command

Guy's I have script doing many steps as the below ... ############# ## step1# mount all Files system mount all ## step2# Start the application /app/appsh ############# but some time mount points will not be mounted completely so that will give an error if the next step started... (1 Reply)
Discussion started by: Mr.AIX
1 Replies

6. Shell Programming and Scripting

Help with command to Move files by X number to seperate directories

Hello, I need help finding a script that will allow me to move files from one directory to another directory 10k files at a time. I have a directory that has 100 K files in it. I need to have those 100k files broken apart to separate directories each with 10k files in them. Here is the... (8 Replies)
Discussion started by: Geo_Bean
8 Replies

7. AIX

Backup with Pax command. How to verify tape?

Dear all experts online, In my environment of AIX 5300-07, I am currently using "pax" command to backup all filesystems that I need to backup and it will take me around 4 hours time with LTO3 tape drive. When I need to verify the tape after backup, I am using "pax" command to list all files in... (2 Replies)
Discussion started by: kwliew999
2 Replies

8. UNIX for Dummies Questions & Answers

unix command to cound the number of files in a folder

Hi All Can some one help me out. Please tell the unix command to cound the number of files in a folder. Ungent please# Thanks manas (6 Replies)
Discussion started by: manas6
6 Replies

9. UNIX for Dummies Questions & Answers

ls command for listing the number of files

I've searched the man page for an option for the ls command to print the number of files in a directory. I'm moving files and folders around and thought a count of files would be a quick way to determine if I was missed one somewhere. Some "unix's" shells do this I think... maybe linux... ... (4 Replies)
Discussion started by: jimmyc
4 Replies

10. Programming

Command to verify library sources in AIX

Hi there, May I know is there a command to verify and check the *.a file contents for AIX 5.2. How can I link the library file ? Thank you (0 Replies)
Discussion started by: chongks
0 Replies
Login or Register to Ask a Question