ubuntu

Copy a directory along with its content to another directory in Ubuntu

To copy a directory or folder to a location in Ubuntu you can use cp command. It will copy the directory along with its content to the target location.

# If directory does not exist in the target location
------------------------------------------------------
cp -r /path/to/directory /path/to/folder

# Copy a directory with a new directory name
------------------------------------------------------
cp -r /path/to/directory /path/to/folder/NEW_DIR_NAME
Was this helpful?