What is the difference between following 2 commands?
cp -rp /dir1/*.* /dir2/ cp -rp /dir1/* /dir2/
*.* only matches filenames with a dot in the middle or at the end. For example:
* matches the filenames above, plus the names which don't have a dot at all. for example:
Suppose your have following files in
foobar foo.bar fo.ba foo1.bar2 foobar1 foobar2
cp -rp /dir1/*.* /dir2/
This command will copy only the following files:
foo.bar fo.ba foo1.bar2
cp -rp /dir1/* /dir2/
This will copy all the files in
The condition applies to the subdirectories in
/dir1 as well..