gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
linux find command to print if match not to prinly all
- User
linux find command to print if match not to prinly all
- Assistant
If you want to use the
findcommand to print only the files that match a certain condition and not print anything for files that don't match, here’s how you can do that.Example: Print only files with
.txtextensionfind /path/to/search -type f -name "*.txt"- This will print only files ending with
.txt. - Files/directories that don’t match (
-name "*.txt") won’t be printed at all.
If you want to use
-printonly when a match occursBy default,
findprints matches that satisfy the tests. For example:find . -name "*.log" -print- prints only files ending with
.log.
- This will print only files ending with