3

Lets say I have following files in a folder

  • Blue-Green-Red
  • Red-Yellow-Blue
  • Green-Black-red

Now I want to search files having 'green' and 'red' as part of their names (case insensitive), how i do that via nautilus or any GUI? Back in windows it was easy via total commander...especially if you are dealing with media files & want to 'queue play' only files meeting above criteria thus terminal options are of no use!

  • You asked about "Total Commander", I don't know what that software is like now, but have a look at mc ("Midnight Commander"). – guntbert Feb 09 '13 at 22:13

3 Answers3

1

From Nautilus, type:

green red

enter image description here

1

I suggest using the find command as follows:

find . -maxdepth 1 -regextype posix-egrep -iregex '.*red.*green.*|.*green.*red.*'

What this does:

find = Just what it says

. = where

-maxdepth 1 = current folder only

-regextype posix-egrep = specifies that we're using Regular expressions of type posix-egrep

-iregex = case insensitve expression

.* = any character repeated 0 or more times

expression1|expression2 = either expression1 or expression2 (in this case anything + red + anything + green + anything OR anything + green + anything + red + anything

To Do
  • 15,502
  • Thanks for explanation but terminal options aren't the answer when after searching specified files we have to en-queue them in VLC player – nightcrawler Feb 10 '13 at 11:22
  • 1
    That was not specified in the question, but now that you say it, you can enqueue such a list to VLC by piping the results to an .m3u file like this: find . -maxdepth 1 -regextype posix-egrep -iregex '.*red.*green.*|.*green.*red.*' > playlist.m3u. Then open the file in VLC. – To Do Feb 10 '13 at 11:30
0

I think searching for red green lists the files and folders with both search terms in the name. However, you can always search for green*red, and then for red*green, it will give the desired results. I do not know if there is even an AND boolean operand that you can use in nautilus.

João André
  • 1,300
  • 3
  • 17
  • 23