linux - [Solved-3 Solutions] How to copy folder with files to another folder in Unix/Linux ? - ubuntu - red hat - debian - linux server - linux pc
Linux - Problem :
How to copy folder with files to another folder in Unix/Linux ?
Linux - Solution 1:
The option you're looking for is -R.
If destination doesn't exist, it will be created.
Linux - Solution 2:
- You are looking for the cp command. You need to change directories so that you are outside of the directory you are trying to copy.
- If the directory you're copying is called dir1 and you want to copy it to your /home/Pictures folder
- Linux is case-sensitive and also needs the / after each directory to know that it isn't a file. ~ is a special character in the terminal that automatically evaluates to the current user's home directory.
- If you need to know what directory you are in, use the command pwd.
- When you don't know how to use a Linux command, there is a manual page that you can refer to by typing
Linux - Solution 3:
Use this code: