search for files excluding binary files | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

search for files excluding binary files

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-04-2007
user_prady user_prady is offline
Registered User
 
Join Date: Sep 2007
Last Activity: 6 November 2008, 4:05 AM EST
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
search for files excluding binary files

Hi All,

I need a solution on my following find command

find ./.. -name '*.file' -print

BTW This gives me the output as belows

./rtlsim/test/ADCONV0/infile/ad0_dagctst.file
./rtlsim/test/ADCONV0/user_command.file
./rtlsim/test/ADCONV0/simv.daidir/scsim.db.dir/scsim.db.file
./rtlsim/test/DACONV0/infile/da0_txosc_swap.file
./rtlsim/test/DACONV0/infile/da0_txosc_trim.file
./rtlsim/test/DACONV0/simv.daidir/scsim.db.dir/scsim.db.file
./rtlsim/test/RFREG/infile/rrg_sdtest_001.file
./rtlsim/test/RFREG/infile/rrg_test01.file
./rtlsim/test/RFREG/simv.daidir/scsim.db.dir/scsim.db.file
./rtlsim/test/lvdsr0/infile/lr0_sleep_002.file
./rtlsim/test/lvdsr0/user_command.file
./rtlsim/test/lvdsr0/simv.daidir/scsim.db.dir/scsim.db.file
./rtlsim/test/lvdst0/infile/lt0_LoopBack.file


My problem I dont want to search that file scsim.db.file which is a binary file but the other files except that scsim.db.file are text file.

Is there any way to search for files excluding binary files .

or pls help me to search the file with having extension .file but it should not include any other files like scsim.db.file
Sponsored Links
    #2  
Old 09-04-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
Something like this

Code:
$ find . -name "*.file" -type f -print | xargs file | grep ASCII | cut -d: -f1

Cheers,
ZB
Sponsored Links
    #3  
Old 09-05-2007
user_prady user_prady is offline
Registered User
 
Join Date: Sep 2007
Last Activity: 6 November 2008, 4:05 AM EST
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by zazzybob View Post
Something like this

Code:
$ find . -name "*.file" -type f -print | xargs file | grep ASCII | cut -d: -f1

Cheers,
ZB
I love this site and love the people here..

Great help indeed.. Thanks..

Pradyu
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search all files based on first and in all listed files search the second patterns Black-Linux SuSE 1 05-01-2011 06:10 AM
Count number of files in directory excluding existing files ammu UNIX for Dummies Questions & Answers 3 08-25-2010 01:54 PM
Find files of specific size excluding search in a subdirectory usha rao Shell Programming and Scripting 6 04-12-2010 02:41 AM
listing files excluding files from control file ukatru UNIX for Advanced & Expert Users 15 08-15-2008 08:24 PM
text files, ASCII files, binary files and ftp transfers Perderabo Answers to Frequently Asked Questions 0 04-08-2004 04:25 PM



All times are GMT -4. The time now is 12:26 PM.