Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Creating a List of Files With Find Post 302326787 by 008_ on Friday 19th of June 2009 12:11:12 AM
Old 06-19-2009
I've found a solution for what I am after
Code:
find . -exec grep -l "^[ab]" {} \;

This will give me a list of file paths for files where the first two characters within the file are "ab". I can redirect this output into a file to get what I need.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find the list of files

How to find the list of files of particular type present in Directory and sub-directory. (2 Replies)
Discussion started by: senthilk615
2 Replies

2. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies

3. Shell Programming and Scripting

I need a script to find socials in files and output a list of those files

I am trying to find socail security numbers in files in (and under) a specific directory and output a list of the files where they are found... the format would be with no dashes just 9 numeric characters in a row. I have tried this: find /DirToLookIn -exec grep '\{9\}' /dev/null {} \; >>... (1 Reply)
Discussion started by: NewSolarisAdmin
1 Replies

4. UNIX for Dummies Questions & Answers

Find files and display only directory list containing those files

I have a directory (and many sub dirs beneath) on AIX system, containing thousands of file. I'm looking to get a list of all directory containing "*.pdf" file. I know basic syntax of find command, but it gives me list of all pdf files, which numbers in thousands. All I need to know is, which... (4 Replies)
Discussion started by: r7p
4 Replies

5. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

6. UNIX for Dummies Questions & Answers

Creating a list of files in directory?

Hi All, I would like to do a loop on all the files with extension .out in my directory this files should be sorted alphabetically. Then I need to assign to each of them a progressive ID of three digits (maybe in HEX format?). First I tried to list manually the files as ARRAY=( A-001.out ... (5 Replies)
Discussion started by: f_o_555
5 Replies

7. Shell Programming and Scripting

Copying a files from a filter list and creating their associated parent directories

Hello all, I'm trying to copy all files within a specified directory to another location based on a find filter of mtime -1 (Solaris OS). The issue that I'm having is that in the destination directory, I want to retain the source directory structure while copying over only the files that have... (4 Replies)
Discussion started by: hunter55
4 Replies

8. Shell Programming and Scripting

Creating a list of files retrieved from MGET

Is there a way to create a txt file with the names of the files I retreive using mget *.file. I want to use this file as input to a delete command. Using HP-UX (3 Replies)
Discussion started by: jagf
3 Replies

9. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

10. UNIX for Beginners Questions & Answers

Find for files within a list of subfolders

Helo Is there a better way to search within a list of subfolders : A_START_PATH="/data_1/data_2" # # dir2, dir3, dir6, ..... dir59 exists # A_LIST="$A_START_PATH/dir1 $A_START_PATH/dir4 $A_START_PATH/dir5" find "$A_LIST" -type f -name"*.txt" Now searching for all files in any subdirs... (2 Replies)
Discussion started by: jcdole
2 Replies
Module::CPANTS::Kwalitee::Files(3pm)			User Contributed Perl Documentation		      Module::CPANTS::Kwalitee::Files(3pm)

NAME
Module::CPANTS::Kwalitee::Files - Check for various files SYNOPSIS
Find various files and directories that should be part of every self-respecting distribution. DESCRIPTION
Methods order Defines the order in which Kwalitee tests should be run. Returns 10, as data generated by "MCK::Files" is used by all other tests. map_filenames get db_filenames from real_filenames analyse "MCK::Files" uses "File::Find" to get a list of all files and dirs in a dist. It checks if certain crucial files are there, and does some other file-specific stuff. get_files The subroutine used by "File::Find". Unfortunantly, it depends on some global values. kwalitee_indicators Returns the Kwalitee Indicators datastructure. o extractable o extracts_nicely o has_readme o has_manifest o has_meta_yml o has_buildtool o has_changelog o no_symlinks o has_tests o has_tests_in_t_dir o buildfile_not_executabel o has_example (optional) o no_generated_file o has_version_in_each_file o no_stdin_for_prompting SEE ALSO
Module::CPANTS::Analyse AUTHOR
Thomas Klausner <https://metacpan.org/author/domm> COPYRIGHT AND LICENSE
Copyright X 2003X2006, 2009 Thomas Klausner <https://metacpan.org/author/domm> You may use and distribute this module according to the same terms that Perl is distributed under. perl v5.14.2 2012-06-08 Module::CPANTS::Kwalitee::Files(3pm)
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy