Finding files not ending with specific extensions

Limeth

I'm making a bash script; how do I find files not ending with specific extensions?

#!/bin/bash
find . -type f -print | grep "\.\(?!psd\|xcf\).+$"

Thank you.

anubhava

You can use:

find . -regextype posix-egrep -type f ! -regex '.*\.(psd|xcf)$'

Or without regex:

find . -type f -not \( -name '*.psd' -o -name '*.xcf' \)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Finding files not ending with specific extensions

From Dev

List all the files in ending with several file extensions?

From Dev

Finding and copying files with same name but different extensions

From Dev

gzip all files with specific extensions

From Dev

gzip all files with specific extensions

From Dev

Remove files with specific extensions by regexp

From Dev

wget, download linked files with specific ending

From Dev

Finding and deleting files with a specific date

From Dev

finding specific files and data inside files

From Dev

Removing Files with specific ending. Need something more specific

From Dev

Removing Files with specific ending. Need something more specific

From Dev

Finding strings with a specific number of letters, extensions included with grep

From Dev

mass copy files of specific extensions to folder

From Dev

Recursively searching for files with specific extensions in a directory

From Dev

mass copy files of specific extensions to folder

From Dev

Fetch files with specific extensions using iOS SDK

From Dev

Finding files in a specific date and then search for a phone number

From Dev

Finding files in a specific date and then search for a phone number

From Dev

bash script for creating a text file with all files with specific ending

From Dev

Unix: List files with specific ending and show their size and date

From Dev

How to retrieve recursively any files with a specific extensions in PowerShell?

From Dev

How to hide specific files extensions (html & php) in URL?

From Dev

for loop in bash go though files with two specific extensions

From Dev

Searching for directories that contain two files of any name, with specific extensions

From Dev

Searching for directories that contain two files of any name, with specific extensions

From Dev

Find files modified in the last 2 days for specific extensions?

From Dev

Using process substitution to trick programs expecting files, with specific extensions as argument?

From Dev

Change all files from a specific folder extensions in AutoIT

From Dev

Using wget to download files that match extensions and specific text in the filename

Related Related

  1. 1

    Finding files not ending with specific extensions

  2. 2

    List all the files in ending with several file extensions?

  3. 3

    Finding and copying files with same name but different extensions

  4. 4

    gzip all files with specific extensions

  5. 5

    gzip all files with specific extensions

  6. 6

    Remove files with specific extensions by regexp

  7. 7

    wget, download linked files with specific ending

  8. 8

    Finding and deleting files with a specific date

  9. 9

    finding specific files and data inside files

  10. 10

    Removing Files with specific ending. Need something more specific

  11. 11

    Removing Files with specific ending. Need something more specific

  12. 12

    Finding strings with a specific number of letters, extensions included with grep

  13. 13

    mass copy files of specific extensions to folder

  14. 14

    Recursively searching for files with specific extensions in a directory

  15. 15

    mass copy files of specific extensions to folder

  16. 16

    Fetch files with specific extensions using iOS SDK

  17. 17

    Finding files in a specific date and then search for a phone number

  18. 18

    Finding files in a specific date and then search for a phone number

  19. 19

    bash script for creating a text file with all files with specific ending

  20. 20

    Unix: List files with specific ending and show their size and date

  21. 21

    How to retrieve recursively any files with a specific extensions in PowerShell?

  22. 22

    How to hide specific files extensions (html & php) in URL?

  23. 23

    for loop in bash go though files with two specific extensions

  24. 24

    Searching for directories that contain two files of any name, with specific extensions

  25. 25

    Searching for directories that contain two files of any name, with specific extensions

  26. 26

    Find files modified in the last 2 days for specific extensions?

  27. 27

    Using process substitution to trick programs expecting files, with specific extensions as argument?

  28. 28

    Change all files from a specific folder extensions in AutoIT

  29. 29

    Using wget to download files that match extensions and specific text in the filename

HotTag

Archive