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.

  • 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 '18 at 13:47

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:


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
| 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 '18 at 15:42
  • Run ls /home ... – Panther Dec 2 '18 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 '18 at 16:05
  • 1
    ~ is a variable which directly references the current users home directory. – Panki Dec 2 '18 at 17:15
  • 1
    @Designer This is too broad to automate easily, though it may be done, as per the comments above. – user147505 Dec 2 '18 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.