How can i copy files from any usb stick to user's home directory using terminal commanld line?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












As i mentioned in my question title above i have a usb stick that contains the folders "theme" and "icons". I want to copy those 2 folders in the folder home/andrew/.config folder of my computer or any other computer. How can i do that using the terminal?



I am on a Linux Mint xfce system.










share|improve this question

















  • 2




    If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
    – Haxiel
    Dec 2 at 13:47















up vote
0
down vote

favorite












As i mentioned in my question title above i have a usb stick that contains the folders "theme" and "icons". I want to copy those 2 folders in the folder home/andrew/.config folder of my computer or any other computer. How can i do that using the terminal?



I am on a Linux Mint xfce system.










share|improve this question

















  • 2




    If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
    – Haxiel
    Dec 2 at 13:47













up vote
0
down vote

favorite









up vote
0
down vote

favorite











As i mentioned in my question title above i have a usb stick that contains the folders "theme" and "icons". I want to copy those 2 folders in the folder home/andrew/.config folder of my computer or any other computer. How can i do that using the terminal?



I am on a Linux Mint xfce system.










share|improve this question













As i mentioned in my question title above i have a usb stick that contains the folders "theme" and "icons". I want to copy those 2 folders in the folder home/andrew/.config folder of my computer or any other computer. How can i do that using the terminal?



I am on a Linux Mint xfce system.







linux linux-mint terminal xfce xfce4-terminal






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 2 at 13:20









Designer

1015




1015







  • 2




    If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
    – Haxiel
    Dec 2 at 13:47













  • 2




    If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
    – Haxiel
    Dec 2 at 13:47








2




2




If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
– Haxiel
Dec 2 at 13:47





If it's just a one-time copy, running cp -r src-dir dest-dir should be sufficient. Are you looking for something more advanced?
– Haxiel
Dec 2 at 13:47











1 Answer
1






active

oldest

votes

















up vote
0
down vote













Given your username is Andrew or rather andrew, it will most likely be mounted under /media/andrew/a_volume_name. So first you need to get this full path. You can store it in a shell variable to make things easy:



ls /media/andrew


See or find the right entry in the output, and now save it in the source directory variable:



s_dir=/media/andrew/my_usb_drive


Of course replace my_usb_drive with the right name. Once you have this, enter this command:



cp -r "$s_dir"/theme "$s_dir"/icons /home/andrew/.config





share|improve this answer




















  • Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
    – Designer
    Dec 2 at 15:42










  • Run ls /home ...
    – Panther
    Dec 2 at 16:03










  • The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
    – Panther
    Dec 2 at 16:05






  • 1




    ~ is a variable which directly references the current users home directory.
    – Panki
    Dec 2 at 17:15







  • 1




    @Designer This is too broad to automate easily, though it may be done, as per the comments above.
    – Tomasz
    Dec 2 at 17:21










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485485%2fhow-can-i-copy-files-from-any-usb-stick-to-users-home-directory-using-terminal%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Given your username is Andrew or rather andrew, it will most likely be mounted under /media/andrew/a_volume_name. So first you need to get this full path. You can store it in a shell variable to make things easy:



ls /media/andrew


See or find the right entry in the output, and now save it in the source directory variable:



s_dir=/media/andrew/my_usb_drive


Of course replace my_usb_drive with the right name. Once you have this, enter this command:



cp -r "$s_dir"/theme "$s_dir"/icons /home/andrew/.config





share|improve this answer




















  • Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
    – Designer
    Dec 2 at 15:42










  • Run ls /home ...
    – Panther
    Dec 2 at 16:03










  • The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
    – Panther
    Dec 2 at 16:05






  • 1




    ~ is a variable which directly references the current users home directory.
    – Panki
    Dec 2 at 17:15







  • 1




    @Designer This is too broad to automate easily, though it may be done, as per the comments above.
    – Tomasz
    Dec 2 at 17:21














up vote
0
down vote













Given your username is Andrew or rather andrew, it will most likely be mounted under /media/andrew/a_volume_name. So first you need to get this full path. You can store it in a shell variable to make things easy:



ls /media/andrew


See or find the right entry in the output, and now save it in the source directory variable:



s_dir=/media/andrew/my_usb_drive


Of course replace my_usb_drive with the right name. Once you have this, enter this command:



cp -r "$s_dir"/theme "$s_dir"/icons /home/andrew/.config





share|improve this answer




















  • Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
    – Designer
    Dec 2 at 15:42










  • Run ls /home ...
    – Panther
    Dec 2 at 16:03










  • The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
    – Panther
    Dec 2 at 16:05






  • 1




    ~ is a variable which directly references the current users home directory.
    – Panki
    Dec 2 at 17:15







  • 1




    @Designer This is too broad to automate easily, though it may be done, as per the comments above.
    – Tomasz
    Dec 2 at 17:21












up vote
0
down vote










up vote
0
down vote









Given your username is Andrew or rather andrew, it will most likely be mounted under /media/andrew/a_volume_name. So first you need to get this full path. You can store it in a shell variable to make things easy:



ls /media/andrew


See or find the right entry in the output, and now save it in the source directory variable:



s_dir=/media/andrew/my_usb_drive


Of course replace my_usb_drive with the right name. Once you have this, enter this command:



cp -r "$s_dir"/theme "$s_dir"/icons /home/andrew/.config





share|improve this answer












Given your username is Andrew or rather andrew, it will most likely be mounted under /media/andrew/a_volume_name. So first you need to get this full path. You can store it in a shell variable to make things easy:



ls /media/andrew


See or find the right entry in the output, and now save it in the source directory variable:



s_dir=/media/andrew/my_usb_drive


Of course replace my_usb_drive with the right name. Once you have this, enter this command:



cp -r "$s_dir"/theme "$s_dir"/icons /home/andrew/.config






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 2 at 13:50









Tomasz

9,12052964




9,12052964











  • Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
    – Designer
    Dec 2 at 15:42










  • Run ls /home ...
    – Panther
    Dec 2 at 16:03










  • The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
    – Panther
    Dec 2 at 16:05






  • 1




    ~ is a variable which directly references the current users home directory.
    – Panki
    Dec 2 at 17:15







  • 1




    @Designer This is too broad to automate easily, though it may be done, as per the comments above.
    – Tomasz
    Dec 2 at 17:21
















  • Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
    – Designer
    Dec 2 at 15:42










  • Run ls /home ...
    – Panther
    Dec 2 at 16:03










  • The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
    – Panther
    Dec 2 at 16:05






  • 1




    ~ is a variable which directly references the current users home directory.
    – Panki
    Dec 2 at 17:15







  • 1




    @Designer This is too broad to automate easily, though it may be done, as per the comments above.
    – Tomasz
    Dec 2 at 17:21















Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
– Designer
Dec 2 at 15:42




Is there any wild card for the usb path? For example how can i copy my usb folders to a friend's computer if i dont know the name of his home directory?
– Designer
Dec 2 at 15:42












Run ls /home ...
– Panther
Dec 2 at 16:03




Run ls /home ...
– Panther
Dec 2 at 16:03












The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
– Panther
Dec 2 at 16:05




The usb mount point is variable. /media is deprecated in many modern OS. Run mount to find the mount point
– Panther
Dec 2 at 16:05




1




1




~ is a variable which directly references the current users home directory.
– Panki
Dec 2 at 17:15





~ is a variable which directly references the current users home directory.
– Panki
Dec 2 at 17:15





1




1




@Designer This is too broad to automate easily, though it may be done, as per the comments above.
– Tomasz
Dec 2 at 17:21




@Designer This is too broad to automate easily, though it may be done, as per the comments above.
– Tomasz
Dec 2 at 17:21

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485485%2fhow-can-i-copy-files-from-any-usb-stick-to-users-home-directory-using-terminal%23new-answer', 'question_page');

);

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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?