- Copy an existing file in your current directory to another file in the
current directory and then list your directory to prove that it was done:
cp file1 file2 ls
- Copy a file from a different directory to your current directory and
then list your directory to prove that it was done:
cp /etc/ifconfig my.config ls
- Use the copy command with the "inquire" option. What happens when you try
to copy one file to an already existing file?
cp -i file1 file2
- Use the recursive option to copy an entire subdirectory to a new
subdirectory and then list both directories to prove that it worked:
cp -R subdir1 subdir4 ls subdir1 subdir4
- The copy command accepts "wildcard" characters. Try the command below.
What did it do? List the subdir1 subdirectory to find out.
cp samp* subdir1 ls subdir1
- If you are copying a file from another location to the current directory
and want its name to remain the same, you can use the shorthand "." to
indicate the current directory. Try this for example and note what
happens:
cp /etc/ifconfig . ls
References
0 comments:
Post a Comment