find

hi,

I want to find all *.log file name. Which file name are not using space. Find below---

find $INSTALL_PATH/ -name *.log

the out put is------

cs-manuals.war/content/WebHelpAllConfiguration/Global Configuration Service.log
cs-manuals.war/content/WebHelpReferenceDataManager/Reference Data Manager.log
cs-manuals.war/content/WebHelpGlobalScheduler/Global Scheduler.log
cs-manuals.war/content/WebHelpMyProfile/My Profile.log
cs-manuals.war/content/WebHelpCaseManager/Case Manager.log
cs-manuals.war/content/WebHelpAlarmManagement/Alarm Management.log
cs-manuals.war/content/WebHelpProcessOrchestration/Process Designer.log
cs-manuals.war/content/WebHelpRatingandBilling/Rating and Billing.log
cs-manuals.war/content/WebHelpCACHE Configuration/Global Configuration Service.log
cs-manuals.war/content/WebHelpObjectUploader/Object Uploader.log
cs-manuals.war/content/WebHelpObject Management/Object Administration.log
cs-manuals.war/content/WebHelpUserManagement/User Management.log
cs-manuals.war/content/WebHelpGenericMatcher/NonUsage Matcher.log
cs-manuals.war/content/WebHelpSummaryManagement/Summary Management.log

hrer some file names are using space (for ex. Global Configuration Service.log). this type of file name i don,t want to print.

In your example, you files are using space. Can you give example of both type of files?

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

just put a "not" operator

find . -type f ! -name "* *.log"

Does this work?

find $INSTALL_PATH/ -name '*[^ ]*.log'

hi pludi,

find $INSTALL_PATH/ -name '[^ ].log'

its not working.

---------- Post updated at 04:45 PM ---------- Previous update was at 04:43 PM ----------

hi ghostdog74,

find . -type f ! -name "* *.log"

this code is not working. this code is find all file not particular log file.

find $INSTALL_PATH/ -type f ! -name "* *" |grep log$

the grep is redundant. to find all log files, just put it in -name.

---------- Post updated at 06:27 AM ---------- Previous update was at 06:26 AM ----------

the code finds all log files without spaces in them. if its not what you want....don't just say it is not working..show why its not working...your output, any error messages etc...

Thanks rdcwayx

it's working