1

Last night I decided to update my Ubuntu 14.04. When the update finished I decided to reboot. When I did I got stuck in a login in loop. So, I came here to the board to look for answers. I found this link and tried some of the solutions to no avail. Ubuntu gets stuck in a login loop

Before I go any further I would like to save my files via cli to an external harddrive. I have a Seagate FreeAgent external harddrive that I want to put my downloads, pictures, documents, etc. What are the command lines that I need to know in order to do this?

If anyone has a solution to the login loop problem I would love to hear it. This is pretty frustrating to see my files right there and not be able to access them.

2 Answers2

1

From a command line prompt use the copy command. You need the path to your USB device.

Syntax

cp source destination
cp dir1 dir2
cp -option  source destination
cp -option1 -option2  source destination

From your question, you want

cp -r /home/username/Documents /usb_backup_destination
cp -r /home/username/Downloads /usb_backup_destination

and, so on for each directory you wish to copy.

If you need to find the path to your USB backup device, run

sudo blkid

The output for your device will be listed after all the HDD's an usually starts with sdb

/dev/sdb1: UUID="36C9-BC77" TYPE="vfat" PARTUUID="e10284e8-01"

with one line for each partition. The UUID, without quotes, will be needed to identify the target destination for your copy command. Your destination usually mounts as:

/media/<your_username/<your_sbd>

So, your copy command should look like this.

cp -r ~/Downloads /media/<your_username>/device_UUID
RCF
  • 2,097
  • 4
  • 19
  • 25
0

cp item directory is how you copy files into a directory. If you want to copy a directory, make sure to use the -r argument. Type in man cp for more info.

  • I don't understand. Could you please elaborate how to get the files to my external hd? Thanks for your response. – Jay Holloway Jul 19 '15 at 20:43
  • Say you wanted to copy a file called bob.txt to a directory called /exhdd. Go to the directory with the file called bob.txt and then in the shell prompt type in cp bob.txt /exhdd. Say bob.txt was in a directory called /bob and you wanted to copy the full directory to your external hdd . Then you would need to type in cp -r /bob /exhdd. Hope it is helpful. – shredalert Jul 19 '15 at 20:47
  • Thanks I will try that. Will it work for a whole folder? Could I type "cp Documents /exhdd" ? – Jay Holloway Jul 19 '15 at 20:55
  • Let me try and clear it up more (I'm a bit new to linux as well). To find out the name of the directory of your exhdd, type in cd /media. This is the directory which usually contains mount points for removable media that are mounted automatically at insertion. Now make note of the name of the directory of your exhdd, I will refer to it as /exhdd in the shell command. In linux, folders are usually called directories. If Documents is the directory you want to copy, the command you need is cd -r Documents /exhdd. You need the -r recursive argument if you ever want to copy a directory. – shredalert Jul 19 '15 at 21:01