From one of your comments, it sounds as if what you're intending to do is to create a list of pathnames of files that you'd like to transfer from the remote system to the local machine using
scp. The issue with this is that you passing pathnames back and forth between the two systems which introduces the risk that filenames that includes whitespace characters may be mangled.
If you're looking for a way to transfer all the files that matches
something* from somewhere under
/home/ubuntu/user/someFolder on the remote machine, you may use
rsync like this:
rsync -av --include='*/' --include='something*' --exclude='*' \
This would find and transfer all files matching the pattern and the directory structure that they live in to the local machine under the path
--exclude patterns are applied from left to right and the first match is what matters:
--include='*/': Look into all subdirectories (empty directories, i.e. directories with no matching filenames, are not transferred due to
--include='something*': The pattern that would match the things we're actually interested in.
--exclude='*': Ignore everything else.