Linux - Copy only attributes of files in a folder [closed]

1

From the beginning ... I had a problem with my partitioning and I needed to clear my hard drive. I'm running Linux Mint 19 on Live-CD (USB) so I can copy the contents of my / home folder (which was on another partition - / dev / sda6 - and mounted on / mnt) to an external hard drive. For this, I used the command:

cp -r /mnt/user /media/mint/Samsung\ M3/BKP/Linux/home/user -v .

Result: All files have been copied successfully. However, they did not come with the proper permissions, attributes, owners and so on.

How can I recover this information (copy only the attributes of the original files to those of the existing backup)?

    
asked by anonymous 10.07.2018 / 22:49

1 answer

1

When copying information from owners and groups of the file, use the -p parameter, in which case the command to copy the files and keep the permissions would be:

cp -rp /mnt/user /media/mint/Samsung\ M3/BKP/Linux/home/user -v

More details of the cp command can be seen on the terminal itself with the command man cp

    
11.07.2018 / 13:37