Computing.Net > Forums > Unix > Display number of files on screen

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Display number of files on screen

Reply to Message Icon

Name: Mike
Date: October 26, 2002 at 16:33:45 Pacific
OS: windowsXP
CPU/Ram: pentium4-256RAM
Comment:

I would like to know how to write a script that provides a file, "allFiles", that contains a list of all files in the current directory and displays on the screen the number of files present in the current directory?



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: October 26, 2002 at 18:33:44 Pacific
Reply:

ls -lA
ls -lA | wc -l

this works on linux. Check the man pages for your version of ls.


0

Response Number 2
Name: Rex Lopez
Date: October 28, 2002 at 16:09:58 Pacific
Reply:

The above example includes directorys.
If you only want the files try:

ls -lA | grep -v '^d' | wc -l


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


print a file line-by-line killer script



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Display number of files on screen

Count # of files with a string www.computing.net/answers/unix/count-of-files-with-a-string/7511.html

file handles on unix www.computing.net/answers/unix/file-handles-on-unix/1580.html

AVI files on Sun www.computing.net/answers/unix/avi-files-on-sun/452.html