Question

Can you copy multiple directories and their contents into another directory? Show us with examples.

Can you copy multiple directories and their contents into another directory? Show us with examples.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Yes, it's possible..!!!
COMMAND:

praveen_kumar@LAP-LIN-901:~/Desktop$ tree test
test
├── test1
│   └── a.txt
├── test2
│   └── b.txt
└── test3

3 directories, 2 files
praveen_kumar@LAP-LIN-901:~/Desktop$ cd test
praveen_kumar@LAP-LIN-901:~/Desktop/test$ cp -r test1 test2 test3/
p
raveen_kumar@LAP-LIN-901:~/Desktop/test$ cd ..
praveen_kumar@LAP-LIN-901:~/Desktop$ tree test
t
est
├── test1
│   └── a.txt
├── test2
│   └── b.txt
└── test3
├── test1
│   └── a.txt
└── test2
└── b.txt

5 directories, 4 files
############ test1 and test2 folders are COPIED into test 3 ##################

LIVE DEMO:

Add a comment
Know the answer?
Add Answer to:
Can you copy multiple directories and their contents into another directory? Show us with examples.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Displays the names of the non-hidden files and directories in the current directory, or another directory,...

    Displays the names of the non-hidden files and directories in the current directory, or another directory, along with creation time, and size of file. In case of subdirectories, it displays the word <DIR> instead of file size. At the end, the command should display the total number of files in the directory, the total file size, and the number of sub-directories. Examples: LodgherDir (displays info of all files and directories in current directory) LodgherDir c:\LFromDir (displays info of all files...

  • A File class object may refer to a data file or a directory. The IntelliJ project...

    A File class object may refer to a data file or a directory. The IntelliJ project Directory List Demo, discussed starting on page 8, shows how to get information about the contents of a directory using File class methods list() and listFle(). The IntelliJ project Create DirectoriesDemo, starting on page 10, shows how to make a set of directories using the File class method mkdir(). The IntelliJ project CopyFileDemoE has a method to copy a file. Your task is to...

  • Question 11     You are in the oranges directory. Write the command to copy the mandarin...

    Question 11     You are in the oranges directory. Write the command to copy the mandarin file to the apples directory. Use a relative path. 2 points Question 12     Which command do you use to rename files and directories?        A.         uname        B.         mv        C.         rn        D.         rename 2 points Question 13     You are in the oranges directory. Write the command to list...

  • Your software should: Ask the user for the source directory and a destination. The source is...

    Your software should: Ask the user for the source directory and a destination. The source is the directory to be copied; the destination is the directory that will be the parent of the new copy. First your program should make a new directory in the new location with the same name as the source directory. (You may need to do something special for root directories if you are copying an entire disk. A root directory has no parent directory, and...

  • 5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permi...

    5.Create two files also called file file1 and file2 in testdir_2 Use the ls -lR to show you created the directories 6. Change the permission of the files in the directories below and show their permissions testdir/testdir_1/file1 where owner has read and execute permissions testdir/testdir_1/file2 where where owner has read, write and execute permissions. Group has read only permissions 7. Create a directory called newdir/newdir_1/newdir_2 copy the file testdir/testdir_1/file1 to this directory Change the permisions of the file to owner,...

  • Having a hard time copying a file from a directory into another directory/subdirectory in Unix. I...

    Having a hard time copying a file from a directory into another directory/subdirectory in Unix. I am using the cp command but it is not working.   I am trying to copy the files intro and phonebook from directory chap03 into directory homework/A02. Can you help?

  • Question 2: Manipulate directory structures in Unix/Linux (24 marks – 4 marks each) Use the OS...

    Question 2: Manipulate directory structures in Unix/Linux (24 marks – 4 marks each) Use the OS that you set up from Question 1. Assume you are started at your home directory. a) Perform a command that displays the absolute path of your home directory (your current location). b) Create a new directory inside your home directory and name it “Assignment-Two” c) Without moving into the directory you just made (staying in your home directory), create three new directories using one...

  • Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume...

    Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume you are started at your home directory. Perform a command that displays the absolute path of your home directory (your current location). Create a new directory inside your home directory and name it “Assignment-3” Without moving into the directory you just made (staying in your home directory), create two new directories using one command inside of the Assignment-3 directory, and name them Test1 and...

  • Suppose that you wished to copy all of the text files from your fileAsst directory and...

    Suppose that you wished to copy all of the text files from your fileAsst directory and all of the files from your fileAsst/Planes directory into your current directory (without typing out the name of each individual file). What command would you give to make that copy?

  • Problem 8 (18 points): Answer the following questions regarding managing files and directories: a) What command...

    Problem 8 (18 points): Answer the following questions regarding managing files and directories: a) What command would remove the directory /trashbin and all of the files and subdirectories inside of it? b) What command flag can you use with cp so that it doesn’t accidentally overwrite a file if it already exists? c) What command exists to delete a directory if and only if it is already empty? d) Which command can be used to rename a file or directory?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT