Move file to external hard drive sub-directory Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Copy files from internal hard drive to external hard drive using command line in ubuntu 14.04SeaGate FreeAgent External Hard Drive Keeps Auto-mounting RepeatedlyBacking up a VM server to an external USB driveMounting Second Hard Drive in Ubuntu 11.10How can I access an external hard drive through Ubuntu Linux?How do I get GRUB to load properly from a USB external hard drive?Unable to mount hard drive for file copyBackup network CIFS share to external storage16.04 can't mount USB hard drive, but can mount flash drive?How to burn .iso file to external hard-driveHow to mount second hard drive correctly
How would a mousetrap for use in space work?
Can an alien society believe that their star system is the universe?
Why are there no cargo aircraft with "flying wing" design?
Do I really need to have a message in a novel to appeal to readers?
Compare a given version number in the form major.minor.build.patch and see if one is less than the other
What font is "z" in "z-score"?
Is it a good idea to use CNN to classify 1D signal?
How to find all the available tools in mac terminal?
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
How could we fake a moon landing now?
Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?
Extracting terms with certain heads in a function
Maximum summed powersets with non-adjacent items
How to tell that you are a giant?
Did MS DOS itself ever use blinking text?
Using et al. for a last / senior author rather than for a first author
Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?
Delete nth line from bottom
Crossing US/Canada Border for less than 24 hours
First console to have temporary backward compatibility
How do pianists reach extremely loud dynamics?
Significance of Cersei's obsession with elephants?
Can a new player join a group only when a new campaign starts?
Using audio cues to encourage good posture
Move file to external hard drive sub-directory
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Copy files from internal hard drive to external hard drive using command line in ubuntu 14.04SeaGate FreeAgent External Hard Drive Keeps Auto-mounting RepeatedlyBacking up a VM server to an external USB driveMounting Second Hard Drive in Ubuntu 11.10How can I access an external hard drive through Ubuntu Linux?How do I get GRUB to load properly from a USB external hard drive?Unable to mount hard drive for file copyBackup network CIFS share to external storage16.04 can't mount USB hard drive, but can mount flash drive?How to burn .iso file to external hard-driveHow to mount second hard drive correctly
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:
/Backup
/Backup/Jan_02_2016
/Backup/Jun_02_2016
robert_11042016.pdf
pre_install_15102014.pdf
Magazine_2012.pdf
I need to create a new sub-directory named /Backup/Dec_02_2016
. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt
to a new sub-directory /Backup/Dec_02_2016
on the usb drive.
Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with
mount /dev/sdb1 /mnt/usb
and then just copy the file to /mnt/usb
. This would place the file in the main directory of the external USB drive and then I could unmount.
Problem:
Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016
and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.
Question:
Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?
16.04 usb mount hard-drive
add a comment |
I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:
/Backup
/Backup/Jan_02_2016
/Backup/Jun_02_2016
robert_11042016.pdf
pre_install_15102014.pdf
Magazine_2012.pdf
I need to create a new sub-directory named /Backup/Dec_02_2016
. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt
to a new sub-directory /Backup/Dec_02_2016
on the usb drive.
Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with
mount /dev/sdb1 /mnt/usb
and then just copy the file to /mnt/usb
. This would place the file in the main directory of the external USB drive and then I could unmount.
Problem:
Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016
and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.
Question:
Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?
16.04 usb mount hard-drive
add a comment |
I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:
/Backup
/Backup/Jan_02_2016
/Backup/Jun_02_2016
robert_11042016.pdf
pre_install_15102014.pdf
Magazine_2012.pdf
I need to create a new sub-directory named /Backup/Dec_02_2016
. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt
to a new sub-directory /Backup/Dec_02_2016
on the usb drive.
Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with
mount /dev/sdb1 /mnt/usb
and then just copy the file to /mnt/usb
. This would place the file in the main directory of the external USB drive and then I could unmount.
Problem:
Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016
and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.
Question:
Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?
16.04 usb mount hard-drive
I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:
/Backup
/Backup/Jan_02_2016
/Backup/Jun_02_2016
robert_11042016.pdf
pre_install_15102014.pdf
Magazine_2012.pdf
I need to create a new sub-directory named /Backup/Dec_02_2016
. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt
to a new sub-directory /Backup/Dec_02_2016
on the usb drive.
Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with
mount /dev/sdb1 /mnt/usb
and then just copy the file to /mnt/usb
. This would place the file in the main directory of the external USB drive and then I could unmount.
Problem:
Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016
and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.
Question:
Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?
16.04 usb mount hard-drive
16.04 usb mount hard-drive
edited Apr 13 '17 at 12:23
Community♦
1
1
asked Nov 14 '16 at 18:41
edeszedesz
293412
293412
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Mount the device as
/mnt/usb
Create a folder
mkdir -p /mnt/usb/Backup/Dec_02_2016
Copy to the recently mounted device
cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016
Thanks! Why did you usecp -p
instead ofcp
?
– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always usecp -p
? i.e. iscp -p
safer thancp
?
– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
add a comment |
You can simply use move command and set path of hard disk.
sudo mv fromPath/ /media/username/harddisk name/
Thanks.
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f849453%2fmove-file-to-external-hard-drive-sub-directory%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Mount the device as
/mnt/usb
Create a folder
mkdir -p /mnt/usb/Backup/Dec_02_2016
Copy to the recently mounted device
cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016
Thanks! Why did you usecp -p
instead ofcp
?
– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always usecp -p
? i.e. iscp -p
safer thancp
?
– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
add a comment |
Mount the device as
/mnt/usb
Create a folder
mkdir -p /mnt/usb/Backup/Dec_02_2016
Copy to the recently mounted device
cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016
Thanks! Why did you usecp -p
instead ofcp
?
– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always usecp -p
? i.e. iscp -p
safer thancp
?
– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
add a comment |
Mount the device as
/mnt/usb
Create a folder
mkdir -p /mnt/usb/Backup/Dec_02_2016
Copy to the recently mounted device
cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016
Mount the device as
/mnt/usb
Create a folder
mkdir -p /mnt/usb/Backup/Dec_02_2016
Copy to the recently mounted device
cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016
edited Nov 14 '16 at 19:10
wjandrea
9,57142765
9,57142765
answered Nov 14 '16 at 18:46
Larry R. IrwinLarry R. Irwin
1245
1245
Thanks! Why did you usecp -p
instead ofcp
?
– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always usecp -p
? i.e. iscp -p
safer thancp
?
– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
add a comment |
Thanks! Why did you usecp -p
instead ofcp
?
– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always usecp -p
? i.e. iscp -p
safer thancp
?
– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
Thanks! Why did you use
cp -p
instead of cp
?– edesz
Nov 14 '16 at 18:53
Thanks! Why did you use
cp -p
instead of cp
?– edesz
Nov 14 '16 at 18:53
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
That way it preserves the specified attributes of the original files, in case there is any.
– M. Becerra
Nov 14 '16 at 18:59
Thanks. Then should we always use
cp -p
? i.e. is cp -p
safer than cp
?– edesz
Nov 14 '16 at 19:04
Thanks. Then should we always use
cp -p
? i.e. is cp -p
safer than cp
?– edesz
Nov 14 '16 at 19:04
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)
– Tom McKenzie
Oct 11 '18 at 7:13
add a comment |
You can simply use move command and set path of hard disk.
sudo mv fromPath/ /media/username/harddisk name/
Thanks.
New contributor
add a comment |
You can simply use move command and set path of hard disk.
sudo mv fromPath/ /media/username/harddisk name/
Thanks.
New contributor
add a comment |
You can simply use move command and set path of hard disk.
sudo mv fromPath/ /media/username/harddisk name/
Thanks.
New contributor
You can simply use move command and set path of hard disk.
sudo mv fromPath/ /media/username/harddisk name/
Thanks.
New contributor
New contributor
answered 7 mins ago
Sohel KhanSohel Khan
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f849453%2fmove-file-to-external-hard-drive-sub-directory%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown