Title: Caught in loop and need to save files using command line to external harddrive
Tags: command-line;hard-drive;login;external-hdd
Question: 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.
Comment: What type of prompt do you have to work from?

Comment: I use crtl, alt, f1 to get to the CLI. That is the prompt I am working from. I think that answers your question.

Comment: So, I can access my files using the live media disk? How does that work?

Comment: I am using the unity environment.

Comment: Boot from live media and make a backup... you can avoid terminal that way

Comment: You boot the live disk and mount the hardisks. Does `startx` work from a TTY prompt (what desktop environment are you using)?


Here is another answer: 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.
Comment for this answer: I don't understand. Could you please elaborate how to get the files to my external hd? Thanks for your response.
Comment for this answer: Thanks I will try that. Will it work for a whole folder? Could I type "cp Documents /exhdd" ?
Comment for this answer: 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.
Comment for this answer: 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 allencourtney@example.org. 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.

Here is another answer: 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&gt;
So, your copy command should look like this.
cp -r ~/Downloads /media/<your_username&gt;/device_UUID

{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 6, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:07/19/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<command-line><hard-drive><login><external-hdd>', 'Title': 'Caught in loop and need to save files using command line to external harddrive', 'ViewCount': 180, 'id': 650308, 'user_AboutMe': None, 'user_AccountId': 6650872.0, 'user_DisplayName': 'Jay Holloway', 'user_Reputation': 11.0, 'user_Views': 1.0, 'user_id': 431197.0}}