View Single Post

  #1 (permalink)  
Old 07-31-2007, 11:37 AM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 151
Rep Power: 4
raj is on a distinguished road
Default UNIX Display or list number of files in a current directory

Recently I found a command that displays the Number of files in a ls command listing:
Code:
ls -l | wc -l
Above will find the number of files in a directory, and it will send o/p as pipe to the wc -l, which outputs the number of lines in its input.

To display all file including hidden and dot files, try
Code:
ls -lA | wc -l
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote