LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-11-2011, 03:47 AM   #1
threezerous
Member
 
Registered: Jul 2009
Posts: 94

Rep: Reputation: 15
Trying to find unique extensions or formats in a deep folder structure


I have a deep folder structure on my RHEL 5.x file system which is supposed to have only word(*.doc, *.docx) or pdf(*.pdf) files. But I want to check if there are files with any other extensions which exist. Is that possible?

Thanks in advance
 
Old 07-11-2011, 03:55 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Code:
find /path/to/folder -not \( -iname \*.doc -o -iname \*.docx -o -iname \*.pdf \)
 
Old 07-11-2011, 04:10 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
In addition to colucix solution you will find more information on the find-command with
Code:
man find
 
  


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
need linux script to copy large deep directory structure to other filesystem vanvoj Programming 4 11-04-2009 03:19 AM
how to apply "chmod g+r" permissions to a deep file and directory structure htamayo Linux - Newbie 3 03-20-2009 03:45 PM
Need help with a little bash script - generating unique folder names Shay Linux - Software 4 10-31-2008 10:07 PM
find out how many shells deep you are twelvenine Linux - Newbie 4 10-28-2008 05:54 PM
Home Jail Folder Structure like Gobolinux Directory Structure luispt Linux - General 3 07-26-2008 06:46 PM

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

All times are GMT -5. The time now is 06:49 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