Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unix command to count the number of files with specific characters in name Post 302419246 by murphysm on Thursday 6th of May 2010 03:29:56 PM
Old 05-06-2010
MySQL

Quote:
Originally Posted by pseudocoder
Maybe
Code:
find . -name "*-a.jpg" | wc -l

That seems to have worked. ... though my results using that code and searching manually in the Finder (Mac OS) are greatly different. The finder is only showing 275 items while the Unix code is showing 510. Could there be that many hidden files? Is there a way to exclude hidden files?

Just using this smaller folder as a test. Been trying to find a solution since the Mac Finder only shows results up to 10,000 and I have several directories with results well beyond that. Thanks.
 

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
MoreFiles(3)						User Contributed Perl Documentation					      MoreFiles(3)

NAME
Mac::MoreFiles - Sophisticated file management routines SYNOPSIS
use Mac::MoreFiles; $application = $Application{"MrPL"}; DESCRIPTION
Variables %Application The %Application hash will return the path to the application for a given signature, searching on all mounted volumes. Functions FSpCreateMinimum SPEC Create a new file with no creator or file type. The FSpCreateMinimum function creates a new file without attempting to set the the creator and file type of the new file. This function is needed to create a file in an AppleShare "dropbox" where the user can make changes, but cannot see folder or files. The FSSpec in SPEC is used to create the file. FSpShare SPEC Establish a local volume or directory as a share point. The FSpShare function establishes a local volume or directory as a share point. SPEC is an FSSpec record specifying the share point. FSpUnshare SPEC The FSpUnshare function removes a share point in SPEC. FSpFileCopy SRCSPEC, DSTSPEC, COPYNAME, PREFLIGHT The FSpFileCopy function duplicates a file and optionally renames it. Since the PBHCopyFile() routine is only available on some AFP server volumes under specific conditions, this routine either uses PBHCopyFile(), or does all of the work PBHCopyFile() does. The SRCSPEC is used to determine the location of the file to copy. The DSTSPEC is used to determine the location of the destination directory. If COPYNAME <> NIL, then it points to the name of the new file. FSpDirectoryCopy SRCSPEC, DSTSPEC, PREFLIGHT, [COPYERRHANDLER] Make a copy of a directory structure in a new location. The FSpDirectoryCopy function makes a copy of a directory structure in a new location. COPYERRHANDLER is the Perl routine name to handle an error, should one arise. It will be called as: $bailout = &$COPYERRHANDLER(ERRORCODE,OPERATION,SRCSPEC,DSTSPEC); FSpIterateDirectory SPEC, MAXLEVELS, ITERATEFILTER, YOURDATAPTR Iterate (scan) through a directory's content. The FSpIterateDirectory function performs a recursive iteration (scan) of the specified directory and calls your ITERATEFILTER function once for each file and directory found. The MAXLEVELS parameter lets you control how deep the recursion goes. If MAXLEVELS is 1, FSpIterateDirectory only scans the specified directory; if MAXLEVELS is 2, FSpIterateDirectory scans the specified directory and one subdirectory below the specified directory; etc. Set MAXLEVELS to zero to scan all levels. The YOURDATAPTR parameter can point to whatever data structure you might want to access from within the ITERATEFILTER. Your filter function will be called as: $quit = &$filterFunction(YOURDATAPTR, SPEC); FSpDTGetAPPL VOLUME, CREATOR The FSpDTGetAPPL function finds an application (file type 'APPL') with the specified CREATOR on the specified VOLUME. It first tries to get the application mapping from the desktop database. If that fails, then it tries to find an application with the specified creator using the File Manager's CatSearch() routine. If that fails, then it tries to find an application in the Desktop file. Returns FSSpec or "undef" on failure. FSpDTSetComment SPEC, COMMENT The FSpDTSetComment function sets a file or directory's Finder comment field. The volume must support the Desktop Manager because you only have read access to the Desktop file. FSpDTGetComment SPEC The FSpDTGetComment function gets a file or directory's Finder comment field (if any) from the Desktop Manager or if the Desktop Manager is not available, from the Finder's Desktop file. Returns Str255, or "undef" on failure. FSpDTCopyComment SRCSPEC, DSTSPEC The FSpDTCopyComment function copies the desktop database comment from the source to the destination object. Both the source and the destination volumes must support the Desktop Manager. AUTHOR
Written by Matthias Ulrich Neeracher <neeracher@mac.com>, documentation by Bob Dalgleish <bob.dalgleish@sasknet.sk.ca>. Currently maintained by Chris Nandor <pudge@pobox.com>. perl v5.18.2 2017-10-06 MoreFiles(3)
All times are GMT -4. The time now is 07:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy