LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack 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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 01:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration