![]() ![]() For more information on the Linux find command, here’s a link to my Linux ‘find’ command examples article. I hope this quick tip on finding Unix and Linux files and directories that don't match a filename pattern (not matching a pattern) has been helpful. ![]() Summary: How to find files that don’t match a filename pattern type f -not -name "*.html" -exec ls -l \ Here’s how to run a simple Unix ls command on them:įind. Of course it’s usually not enough to find files not matching a filename pattern usually you want to do something with them. This could occur if using text fields to create a join and an expected matching record has a spelling mistake or an uppercase or lowercase character that causes no match to be found. Find files not matching a filename pattern and doing something with them You can compute what percentage of records were successfully matched and determine if there might be other errors in the data if the number of matched records is not what was expected. html file extension (filename pattern).Īlso, if you’re not familiar with it, the -f argument in that find command means “just look for files,” and don’t return search results for directories. This Linux find command using the “not” operator creates a list of all files not ending with the. Fortunately with the newer Unix/Linux find syntax this solution is pretty easy, you just include the -not argument, like this: In my case I just ran into a situation where I needed to find all files below the current subdirectory that are NOT named with the filename pattern *.html. ![]() Unix/Linux find command “patterns” FAQ: How do I find files or directories that don’t match a specific pattern (files not matching a regex pattern, or filename pattern)? Any donation (through ) will help keep this site running ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |