LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2007, 10:04 PM   #1
banajah
Member
 
Registered: Apr 2006
Location: Saudi Arabia
Distribution: RHEL 5
Posts: 32

Rep: Reputation: 15
Cool Determine files type


Hello...
Hope that you are having a nice day....
just I still Newbie in Linux and I want to know how I can determine the files type using " file " command for all files under the subdirectories?
since there is no --recursive option in file command.

Thanks,
 
Old 10-08-2007, 12:16 AM   #2
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 353

Rep: Reputation: 89
This will search the specified directory and all subdirectories:
Code:
find /dir/to/search -type f -print | xargs file
 
Old 10-08-2007, 03:27 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Or
Code:
find /dir/to/search -type f -exec file {} \;
 
Old 10-08-2007, 06:00 PM   #4
banajah
Member
 
Registered: Apr 2006
Location: Saudi Arabia
Distribution: RHEL 5
Posts: 32

Original Poster
Rep: Reputation: 15
Wow, Thanks for the help it's working very well
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine memory type? swagger Linux - Hardware 3 04-17-2006 08:15 PM
How to determine partition type? halturata Linux - General 2 08-11-2005 02:07 PM
How to determine partition type? halturata Linux - General 3 08-11-2005 03:11 AM
How do I determine file system type? lowpro2k3 Linux - General 5 07-09-2005 03:40 PM
How does KDE determine file type? vdemuth Linux - Software 4 01-08-2005 04:08 AM


All times are GMT -5. The time now is 10:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration