What is the difference between following 2 commands?
cp -rp /dir1/*.* /dir2/ cp -rp /dir1/* /dir2/
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
*.* 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..