LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 11: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, 01:16 AM   #2
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
This will search the specified directory and all subdirectories:
Code:
find /dir/to/search -type f -print | xargs file
 
Old 10-08-2007, 04:27 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
Or
Code:
find /dir/to/search -type f -exec file {} \;
 
Old 10-08-2007, 07: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 09:15 PM
How to determine partition type? halturata Linux - General 2 08-11-2005 03:07 PM
How to determine partition type? halturata Linux - General 3 08-11-2005 04:11 AM
How do I determine file system type? lowpro2k3 Linux - General 5 07-09-2005 04:40 PM
How does KDE determine file type? vdemuth Linux - Software 4 01-08-2005 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:44 AM.

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