-6

I am working on an project which is based on system security.I want to move all data from a flash drive into my system hidden folder.But I don't know how can i do this in a single terminal command(bash). Is there any way to do this in Ubuntu?

For example: There are 50 folders in a USB flash drive.Now I want to copy all folder in system and then format the pendrive or simply move data form a pendrive.So how can i do this? I hope you guys understand my question.

Thanks in advance

Nitin
  • 101

1 Answers1

2
cd /media/flashdriveid/

where flashdriveid is your mountpoint

mkdir /home/$USER/.hiddendirectory
cp -R * /home/$USER/.hiddendirectory

and the whole flashdrive will be copied (cp -R is recursive so including subdirectories) to a new directory called ".hiddendirectory" and it is hidden from normal view due to the "." in front of it. If you have an existing hidden dir skip the "mkdir" command and change the "cp" command to the location you want to use.

If you want to move the files from the flashdrive you can exchange "cp" for "mv".

Rinzwind
  • 299,756