Sponsored Content
Top Forums Shell Programming and Scripting count number of files in a directory Post 302316138 by vijayprrm on Thursday 14th of May 2009 07:37:21 AM
Old 05-14-2009
Use ls | wc -l
This lists the total number of files in current directory.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Count number of files in subdirectories

Hello, I am new to unix and would like to have a count of all the files in the current directory as well as all the files in a subdirectory. The command I used was ls -R | wc -l but the number returned wasn't correct. Can someone please help? Thanks (2 Replies)
Discussion started by: cbeverly
2 Replies

2. Shell Programming and Scripting

Count the number of files in a directory

Hi All, How do i find out the number of files in a directory using unix command ? (14 Replies)
Discussion started by: Raynon
14 Replies

3. UNIX for Dummies Questions & Answers

Read directory files and count number of lines

Hello, I'm trying to create a BASH file that can read all the files in my working directory and tell me how many words and lines are in that file. I wrote the following code: FILES="*" for f in "$FILES" do echo -e `wc -l -w $f` done My issue is that my file is outputting in one... (4 Replies)
Discussion started by: jl487
4 Replies

4. Shell Programming and Scripting

perl script on how to count the total number of lines of all the files under a directory

how to count the total number of lines of all the files under a directory using perl script.. I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Discussion started by: adityam
5 Replies

5. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

6. Shell Programming and Scripting

How to count the number of files starting with a pattern in a Directory

Hi! In our current directory there are around 35000 files. Out of these a few thousands(around 20000) start with, "testfiles9842323879838". I want to count the number of files that have filenames starting with the above pattern. Please help me with the command i could use. Thank... (7 Replies)
Discussion started by: atechcorp
7 Replies

7. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

8. Shell Programming and Scripting

Count the number of subset of files in a directory

hi I am trying to write a script to count the number of files, with slightly different subset name, in a directory for example, in directory /data, there are a subset of files that are name as follow /data/data_1_(1to however many).txt /data/data_2_(1 to however many).txt... (12 Replies)
Discussion started by: piynik
12 Replies

9. Shell Programming and Scripting

Count number of files

Hi All! I need to have a script that counts the number of files arriving in a landing directory, them some app pick these files to be processed and load to a DB. But this process is so fast that I am not able to count all the files arriving on a landing directory. Please can you help? My... (6 Replies)
Discussion started by: fretagi
6 Replies

10. Shell Programming and Scripting

Count number of pattern matches per line for all files in directory

I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the: -file name -line number -number of matches to the pattern /comp/ for each line. Two example files: cat... (4 Replies)
Discussion started by: pathunkathunk
4 Replies
LBCDCLIENT(1)							   User Commands						     LBCDCLIENT(1)

NAME
lbcdclient - Query a remote lbcd daemon for system load SYNOPSIS
lbcdclient [-2] [-s service[,service ...]] host ... DESCRIPTION
lbcdclient sends a query packet to a remote lbcd server and prints the results. The result output will look something like this: btime 1092858021 ctime 1092960298 utime 1092955199 load l1 96 l5 69 l15 57 total 0 unique 0 console 0 tmp full 0 P_tmpdir full 2 services 0 pads 0 0 service 0: weight 1 increment 1 btime is the time of the last system boot in seconds since epoch. ctime is the current system time in seconds since epoch. utime is the last modification time of the information about logged in users in seconds since epoch. The load line gives the one-minute (l1), five-minute (l5), and fifteen-minute (l15) load averages, multiplied by 100. The next line gives the count of logged-in users. total gives the count of all logged-in users, unique lists the total number of unique users, and console is 1 if a user is logged in to the console of the system. tmp full is the percentage used in the system /tmp directory and P_tmpdir full is the percentage full in the system /var/tmp directory. Finally, the last lines give information for each service, using the extended service response for the version three packet format. The first line gives the count of number of configured services minus one. (The pads numbers are reserved space in the packet and will gener- ally always be zero.) Then, each subsequent line lists the weights and increments for each service lbcd is monitoring on the system. If the -2 option is used, lbcdclient will send a version two packet instead, and the returned results will not include the services line and everything after that. OPTIONS
-2 Send a version two protocol packet instead of a version three packet. Version two doesn't support the separate service weights. -s service,[service ...] Request information for the specified service names. It's not entirely clear whether this works correctly. SEE ALSO
lbcd(8) The current version of this program is available from its web page at <http://www.eyrie.org/~eagle/software/lbcd/>. AUTHORS
Written by Larry Schwimmer. Currently maintained by Russ Allbery <rra@stanford.edu>. 3.3.0 2006-10-06 LBCDCLIENT(1)
All times are GMT -4. The time now is 05:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy