Please Help Me...

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Please Help Me...
# 8  
Old 04-21-2010
Hi all,

I want to script count the total number of file in directory.Hope you can help...Smilie
# 9  
Old 04-21-2010
Use the following command.

Code:
ls -l | grep "^-" | wc -l

It will give the number of files in the current directory.

If you want to know the number of files in a specific directory , then you need to specify its name as

Code:
ls -l  <directory_path> | grep "^-" | wc -l

# 10  
Old 04-21-2010
can you write for me the script?
# 11  
Old 04-21-2010
Quote:
Originally Posted by mastercar
can you write for me the script?
it's starting to look like homework. you have all answers you need. all you need to do now is to use them!

good luck
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question