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
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..