Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-08-2013, 05:55 PM   #16
Senior Member
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444

you need regular expressions

man find
      -iregex pattern
              Like -regex, but the match is case insensitive.
       -regex pattern
              File name matches regular expression pattern.  This is a match on the whole path, not a search.  For example, to match a file named `./fubar3', you can use the regular expression  `.*bar.'
              or `.*b.*3', but not `f.*r3'.  The regular expressions understood by find are by default Emacs Regular Expressions, but this can be changed with the -regextype option.
find . -iregex ".*\.\(\<mp3\>\|\<flac\>\|\<ogg\>\)"
Damn ugly....

       -regextype type
              Changes the regular expression syntax understood by -regex and -iregex tests which occur later on the command line.
Currently-implemented types are emacs (this is the default), posix-awk,
              posix-basic, posix-egrep and posix-extended.

 find -regextype posix-egrep -iregex "*.*(mp3|flac|ogg)"
easier to write and read

but you could do
find . -iname "*.mp3" -o -iname "*.flac" -o -iname "*.ogg"
search regular expression , for tutorials
1 members found this post helpful.
Old 10-08-2013, 09:36 PM   #17
Senior Member
Registered: Apr 2010
Posts: 1,327

Rep: Reputation: 225Reputation: 225Reputation: 225

Originally Posted by kilee View Post
Thank you all.

This has helped me a lot!
One aditional question. Is it possible to define a list of extensions extensions? let's say using this with the find command?

--include-from=/Users/me/Desktop/list.txt --include=*/ --exclude=*

Where List.txt includes all the possible extensions I need to move?

try this one:

while read line; do 

   find / -iname $line -type f -exec /bin/mv {} /home/mynewfolder \;

done < List.txt
Good luck!!!
1 members found this post helpful.



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
Cron tab error: No entry for terminal type "unknown"; sing dumb terminal settings. shlomi.s Linux - Software 12 09-06-2011 09:20 AM
terminal error? decksmasher Linux - Software 3 08-17-2009 03:42 PM
Error opening terminal:vt102 and error while loading shared nathan Linux - Software 1 08-11-2009 11:03 PM
Error opening terminal: xterm Terminal type "xterm" unknown Pscylo Slackware 10 04-17-2009 06:33 AM
gnome-terminal error AceTech747 Linux - Software 4 01-04-2004 05:21 PM > Forums > Linux Forums > Linux - Newbie

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

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