Unix find files not matching name




















But it is not working. To find files by matching a pattern in file name. Hi all, I have to check whether certain files exist using a if statement. I have to check this by matching a pattern of filename: e. However, this statement is checking only Find files matching a pattern. Script to find file name for non matching pattern. Hi, I want to list only the file names which do not contain a specific keyword or search string.

OS: Solaris Also is there any way ; through the same script I can save the output of search to a CSV comma seperated so that the file can be used for inventory purpose.

Any assistance will RedHat Commands. OpenSolaris Commands. Linux Commands. SunOS Commands. You could list the files with ls -1 and perform a grep -v to exclude the files that do not meet a condition.

Since you just want a count, you can pipe that through wc -l and get the count. For example. The only issue is that it also includes the first line which is that of total. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. Asked 2 years, 6 months ago. Active 2 years, 6 months ago. To use the find command, at the Unix prompt, enter:. Leave the double quotes in.

The find command will begin looking in the starting directory you specify and proceed to search through all accessible subdirectories. You may specify more than one starting directory for searching. By default, multiple options are joined by "and". You may specify "or" with the -o flag and the use of grouped parentheses.

Viewed k times. Improve this question. Cristian Diaconescu Cristian Diaconescu This question has more answers here: List files not matching a pattern? Add a comment.

Active Oldest Votes. Or without and the need to escape it: find. Improve this answer. T Zengerink 4, 5 5 gold badges 29 29 silver badges 31 31 bronze badges.

Hardy Hardy On the other hand, -name is case sensitive while -iname is case insensitive. Chen Levy Chen Levy On Solaris -not is a bad option, this one with!



0コメント

  • 1000 / 1000