cp non-hidden files only [closed]
ls on its own will only show you non-hidden files. If you replace the echo $file
command with your cp command that should work.
for file in `ls`; do echo $file; done
Something like this would work fine:
for file in `ls`; do cp $file /path/to/desitination; done
There are more complicated ways of doing this, but for your needs this seems suitable enough.
**DISCLAIMER: This does not work if there are spaces in the files names.
A fix would be just using the star wildcard. If you run echo *
you'll notice that this does not expand to hidden files. Thanks to Jonathan Leffler