I am using the following command to retrieve the number of files which names contains sv or json in a given directory in a remote server:
nbs_files=`ssh -q -i ${sshkey} ${user}@${server} "find ${path}/ -maxdepth 1 -mindepth 1 -type f -name '*sv*' -o -name '*.json' -exec basename {} \; | wc -l"`
This command returns only the number of .json files, whereas files with sv in their names exist in the ${path}.
When I remove the -o -name '*.json' part, the command works well, and returns the number of files containing the 'sv' in their names.
Does anyone know how can I modify the command in order to retrieve the files containing sv in their names and the files with the extension .json as well?