How can I copy a folder without altering their original dates of creation?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation
command-line
New contributor
add a comment |Â
up vote
3
down vote
favorite
I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation
command-line
New contributor
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation
command-line
New contributor
I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation
command-line
command-line
New contributor
New contributor
edited 9 mins ago
Torquad333
31
31
New contributor
asked 3 hours ago
MelanieDeschene
161
161
New contributor
New contributor
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago
add a comment |Â
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
6
down vote
Read man cp
, and, in addition to the --recursive
switch use one of:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all
add a comment |Â
up vote
2
down vote
sudo cp -rp /home/my_home /media/backup/my_home
orsudo cp -a /home/my_home /media/backup/my_home
This should do it.
-r is recursive
-p is preserve-mode
add a comment |Â
up vote
1
down vote
As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a
(--archive
) option with the cp
command, which is specifically aimed at creating an identical archive copy.
cp -a <source> <destination>
The same can be achieved with the rsync
utility, the local and remote file copy tool that may perform faster than cp
. It also uses the option -a
for the same purpose.
rsync -a <source> <destination>
For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive
:
cp -a /home/$USER/Archive /media/$USER/USB_drive/
or
rsync -a /home/$USER/Archive /media/$USER/USB_drive/
- Both commands will create a folder
Archive
containing all your subfolders and files in the existing destination folder/media/$USER/USB_drive/
. - You can find where your USB drive is mounted in the output of the command
mount | grep /media
- You can leave
$USER
in place if it is for your current user. This variable is automatically substituted by your login name.
add a comment |Â
up vote
0
down vote
simply copying an archive file won't change the created dates of the files/folders in the archive
New contributor
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
Read man cp
, and, in addition to the --recursive
switch use one of:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all
add a comment |Â
up vote
6
down vote
Read man cp
, and, in addition to the --recursive
switch use one of:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Read man cp
, and, in addition to the --recursive
switch use one of:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all
Read man cp
, and, in addition to the --recursive
switch use one of:
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all
answered 3 hours ago
waltinator
21k74168
21k74168
add a comment |Â
add a comment |Â
up vote
2
down vote
sudo cp -rp /home/my_home /media/backup/my_home
orsudo cp -a /home/my_home /media/backup/my_home
This should do it.
-r is recursive
-p is preserve-mode
add a comment |Â
up vote
2
down vote
sudo cp -rp /home/my_home /media/backup/my_home
orsudo cp -a /home/my_home /media/backup/my_home
This should do it.
-r is recursive
-p is preserve-mode
add a comment |Â
up vote
2
down vote
up vote
2
down vote
sudo cp -rp /home/my_home /media/backup/my_home
orsudo cp -a /home/my_home /media/backup/my_home
This should do it.
-r is recursive
-p is preserve-mode
sudo cp -rp /home/my_home /media/backup/my_home
orsudo cp -a /home/my_home /media/backup/my_home
This should do it.
-r is recursive
-p is preserve-mode
answered 3 hours ago
Lewis Smith
887
887
add a comment |Â
add a comment |Â
up vote
1
down vote
As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a
(--archive
) option with the cp
command, which is specifically aimed at creating an identical archive copy.
cp -a <source> <destination>
The same can be achieved with the rsync
utility, the local and remote file copy tool that may perform faster than cp
. It also uses the option -a
for the same purpose.
rsync -a <source> <destination>
For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive
:
cp -a /home/$USER/Archive /media/$USER/USB_drive/
or
rsync -a /home/$USER/Archive /media/$USER/USB_drive/
- Both commands will create a folder
Archive
containing all your subfolders and files in the existing destination folder/media/$USER/USB_drive/
. - You can find where your USB drive is mounted in the output of the command
mount | grep /media
- You can leave
$USER
in place if it is for your current user. This variable is automatically substituted by your login name.
add a comment |Â
up vote
1
down vote
As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a
(--archive
) option with the cp
command, which is specifically aimed at creating an identical archive copy.
cp -a <source> <destination>
The same can be achieved with the rsync
utility, the local and remote file copy tool that may perform faster than cp
. It also uses the option -a
for the same purpose.
rsync -a <source> <destination>
For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive
:
cp -a /home/$USER/Archive /media/$USER/USB_drive/
or
rsync -a /home/$USER/Archive /media/$USER/USB_drive/
- Both commands will create a folder
Archive
containing all your subfolders and files in the existing destination folder/media/$USER/USB_drive/
. - You can find where your USB drive is mounted in the output of the command
mount | grep /media
- You can leave
$USER
in place if it is for your current user. This variable is automatically substituted by your login name.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a
(--archive
) option with the cp
command, which is specifically aimed at creating an identical archive copy.
cp -a <source> <destination>
The same can be achieved with the rsync
utility, the local and remote file copy tool that may perform faster than cp
. It also uses the option -a
for the same purpose.
rsync -a <source> <destination>
For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive
:
cp -a /home/$USER/Archive /media/$USER/USB_drive/
or
rsync -a /home/$USER/Archive /media/$USER/USB_drive/
- Both commands will create a folder
Archive
containing all your subfolders and files in the existing destination folder/media/$USER/USB_drive/
. - You can find where your USB drive is mounted in the output of the command
mount | grep /media
- You can leave
$USER
in place if it is for your current user. This variable is automatically substituted by your login name.
As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a
(--archive
) option with the cp
command, which is specifically aimed at creating an identical archive copy.
cp -a <source> <destination>
The same can be achieved with the rsync
utility, the local and remote file copy tool that may perform faster than cp
. It also uses the option -a
for the same purpose.
rsync -a <source> <destination>
For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive
:
cp -a /home/$USER/Archive /media/$USER/USB_drive/
or
rsync -a /home/$USER/Archive /media/$USER/USB_drive/
- Both commands will create a folder
Archive
containing all your subfolders and files in the existing destination folder/media/$USER/USB_drive/
. - You can find where your USB drive is mounted in the output of the command
mount | grep /media
- You can leave
$USER
in place if it is for your current user. This variable is automatically substituted by your login name.
answered 2 hours ago
vanadium
3,2881925
3,2881925
add a comment |Â
add a comment |Â
up vote
0
down vote
simply copying an archive file won't change the created dates of the files/folders in the archive
New contributor
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
add a comment |Â
up vote
0
down vote
simply copying an archive file won't change the created dates of the files/folders in the archive
New contributor
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
simply copying an archive file won't change the created dates of the files/folders in the archive
New contributor
simply copying an archive file won't change the created dates of the files/folders in the archive
New contributor
New contributor
answered 2 hours ago
ghweq
1
1
New contributor
New contributor
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
add a comment |Â
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
Likely the OP is referring to an old archive folder, not to an archive file
â vanadium
2 hours ago
add a comment |Â
MelanieDeschene is a new contributor. Be nice, and check out our Code of Conduct.
MelanieDeschene is a new contributor. Be nice, and check out our Code of Conduct.
MelanieDeschene is a new contributor. Be nice, and check out our Code of Conduct.
MelanieDeschene is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1085231%2fhow-can-i-copy-a-folder-without-altering-their-original-dates-of-creation%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Note that most Linux filesystems don't store dates of creation â the best you can have is date of last modification.
â Ruslan
32 mins ago