LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2004, 11:56 PM   #1
subu_s
Member
 
Registered: Jun 2004
Posts: 36

Rep: Reputation: 15
linux 'find' to find text files


Hi All,
How do I use a find variation (find . -exec) to find all the non binary files in my path?

Regards,
Subramanian S
 
Old 12-02-2004, 02:10 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If the permissions of the files are set correctly (ie binaries/executables rwx non binaries not rwx) you could do the following:

$ find . -perm -700

This will find all files with rwx for the owner. Group/world settings can be anything due to the - (minus) before the 700.

Using 700 instead of -700 will do an exact match (rwx------ only).

Hope this helps.
 
Old 12-02-2004, 02:56 AM   #3
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
The 'file' command returns the file type so play around with that to see what you want included/excluded in the listing. The following command will return all files whose descriptin contain the word 'text':

find . -exec file {} \; | grep text
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 12:15 AM
How to find files containing specific text? SurfTurtle Linux - Newbie 7 01-05-2008 05:57 AM
How to find a work within a folder full of text files? juanb Linux - General 4 05-03-2005 04:09 PM
find files in text-only? orange400 Linux - General 2 05-27-2004 07:50 AM
How to find text in a set of files? concoran Linux - General 2 06-01-2003 07:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration