I noticed all your filenames have bat either at the very beginning or the very end of the part preceding the. If you only want to find files like that, use: find /path/to/folder -name '*bat*.c' If you want to search case-insensitively, so files containing BAT, bAt, and so forth are matched, use the -iname test instead of the -name test: find /path/to/folder -iname '*bat*' ( The shell expands ~ to your home directory's fully qualified path.) Broadening or Narrowing Your Search, Based on Name To search your home directory, use ~, or the full name of your home directory. To search in the folder you're currently in (e.g., that you've cded to), use. I have quoted the search pattern *bat* because, if the quotes were omitted and files match *bat* in the current directory, the shell will expand *bat* into a list of them and pass that to find. To find all files anywhere inside /path/to/folder whose names contain bat, you can use: find /path/to/folder -name '*bat*'
0 Comments
Leave a Reply. |