Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unix command to count the number of files with specific characters in name Post 302419234 by pseudocoder on Thursday 6th of May 2010 02:45:48 PM
Old 05-06-2010
Maybe
Code:
find . -name "*-a.jpg" | wc -l

Edit: this command looks into subdirectories as well.

Last edited by pseudocoder; 05-06-2010 at 03:58 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

count characters in specific records

I have a text file which represents a http flow like this: HTTP/1.1 200 OK Date: Fri, 23 Jan 2009 17:16:24 GMT Server: Apache Last-Modified: Fri, 23 Jan 2009 17:08:03 GMT Accept-Ranges: bytes Cache-Control: max-age=540 Expires: Fri, 23 Jan 2009 17:21:31 GMT Vary: Accept-Encoding ... (1 Reply)
Discussion started by: littleboyblu
1 Replies

2. Programming

Count the number of repeated characters in a given string

i have a string "dfasdfasdfadf" i want to count the number of times each character is repeated.. For instance, d is repeated 4 times, f is repeated 4 times.. can u give a program in c (1 Reply)
Discussion started by: pgmfourms
1 Replies

3. Shell Programming and Scripting

How to extract specific data and count number containing sets from a file?

Hello everybody! I am quit new here and hope you can help me. Using an awk script I am trying to extract data from several files. The structure of the input files is as follows: TimeStep parameter1 parameter2 parameter3 parameter4 e.g. 1 X Y Z L 1 D H Z I 1 H Y E W 2 D H G F 2 R... (2 Replies)
Discussion started by: Daniel8472
2 Replies

4. Shell Programming and Scripting

Need script to count specific word and iterate over number of files.

Hi Experts, I want to know the count of specific word in a file. I have almost 600+ files. So I want to loop thru each file and get the count of the specific word. Please help me on achieving this... Many thanks (2 Replies)
Discussion started by: elamurugu
2 Replies

5. Shell Programming and Scripting

Count number of characters in particular column

Hi i have data like abchd 124 ldskc aattggcc each separated by tab space i want to count number of characters in 4th column and print it in new column with tabspace for every line can anyone help me how to do it. Thanks. (3 Replies)
Discussion started by: bhargavpbk88
3 Replies

6. Shell Programming and Scripting

how to count how many subdirectory containing more than a certain number of specific file type

hi I want to write a script which count the number of subdirectories in the current root directory that contain more than a specified number of files of a specific type. Is there an easy way to do this? Thanks Robert (2 Replies)
Discussion started by: piynik
2 Replies

7. Shell Programming and Scripting

Count specific characters at specific column positions

Hi all, I need help. I have an input text file (input.txt) like this: 21 GTGCAACACCGTCTTGAGAGG 50 21 GACCGAGACAGAATGAAAATC 73 21 CGGGTCTGTAGTAGCAAACGC 108 21 CGAAAAATGAACCCCTTTATC 220 21 CGTGATCCTGTTGAAGGGTCG 259 Now I need to count A/T/G/C numbers at each character location in column... (2 Replies)
Discussion started by: thienxho
2 Replies

8. 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

9. 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

10. Shell Programming and Scripting

How to count number of characters of wc -l output?

I want count number of characters / find the length of the 'wc -l' output This is the command bash-3.2$ gzcat /home/sid/file1.dat |wc -l 830752 So final out I want is 6 i.e lenght of 830752 I tried with awk bash-3.2$ gzcat /home/sid/file1.dat |wc -l | awk '{print length ($0)... (3 Replies)
Discussion started by: sidnow
3 Replies
du(1B)						     SunOS/BSD Compatibility Package Commands						    du(1B)

NAME
du - display the number of disk blocks used per directory or file SYNOPSIS
/usr/ucb/du [-adkLr] [-o | -s] [filename] DESCRIPTION
The du utility gives the number of kilobytes contained in all files and, recursively, directories within each specified directory or file filename. If filename is missing, `.' (the current directory) is used. A file that has multiple links to it is only counted once. OPTIONS
The following options are supported: -a Generates an entry for each file. -d Does not cross file system boundaries. For example, du -d / reports usage only on the root partition. -k Writes the files sizes in units of 1024 bytes, rather than the default 512-byte units. -L Processes symbolic links by using the file or directory that the symbolic link references, rather than the link itself. -o Does not add child directories' usage to a parent's total. Without this option, the usage listed for a particular directory is the space taken by the files in that directory, as well as the files in all directories beneath it. This option does nothing if the -s option is used. -r Generates messages about directories that cannot be read, files that cannot be opened, and so forth, rather than being silent (the default). -s Only displays the grand total for each of the specified filenames. Entries are generated only for each directory in the absence of options. EXAMPLES
Example 1: Showing usage of all subdirectories in a directory This example uses du in a directory. The pwd(1) command was used to identify the directory, then du was used to show the usage of all the subdirectories in that directory. The grand total for the directory is the last entry in the display: example% pwd /usr/ralph/misc example% du 5 ./jokes 33 ./squash 44 ./tech.papers/lpr.document 217 ./tech.papers/new.manager 401 ./tech.papers 144 ./memos 80 ./letters 388 ./window 93 ./messages 15 ./useful.news 1211 . ENVIRONMENT VARIABLES
If any of the LC_* variables, that is, LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY (see environ(5)), are not set in the environment, the operational behavior of du for each corresponding locale category is determined by the value of the LANG envi- ronment variable. If LC_ALL is set, its contents are used to override both the LANG and the other LC_* variables. If none of the above variables is set in the environment, the "C" (U.S. style) locale determines how du behaves. LC_CTYPE Determines how du handles characters. When LC_CTYPE is set to a valid value, du can display and handle text and filenames containing valid characters for that locale. du can display and handle Extended Unix Code (EUC) charac- ters where any individual character can be 1, 2, or 3 bytes wide. du can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. LC_MESSAGES Determines how diagnostic and informative messages are presented. This includes the language and style of the mes- sages, and the correct form of affirmative and negative responses. In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
pwd(1), df(1M), du(1), quot(1M), attributes(5), environ(5) NOTES
Filename arguments that are not directory names are ignored, unless you use -a. If there are too many distinct linked files, du will count the excess files more than once. SunOS 5.10 5 Jun 2001 du(1B)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy