Copying a Linux File

ARosch

Member
Apr 12, 2012
75
0
61
I need help copying a file from a folder on a linux computer to a flash drive or at least onto the desktop of my linux computer so I can store it on a flash drive.

I am using ssh to access a school computer where the files are saved, I want to copy a file from a folder on the school computer to a folder/desktop/flash drive on the computer I am using now. Is there an easy way to do this? All I need is a way to get said file onto a flash drive.

Thanks.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
If you have SSH access, you should also have access to your files via SFTP. You didn't say which DE you're using, but any reasonably-modern file manager should be able to connect to a remote host with SFTP. If your's doesn't, you'll have a command line SCP client available.
 

ARosch

Member
Apr 12, 2012
75
0
61
I am using ubuntu if that is what you are asking. I dont think I have file manager access, I have just been doing everything through terminal and I thought there was any easy code that I could type in to copy a file to a location or something.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
I dont think I have file manager access, I have just been doing everything through terminal...



I need help copying a file from a folder on a linux computer to a flash drive or at least onto the desktop of my linux computer...

Maybe our terminology is different, but when I see someone talking about copying something to desktop, to me that implies the presence of a graphical interface.
 

Red Squirrel

No Lifer
May 24, 2003
68,481
12,622
126
www.anyf.ca
Easiest way is use filezilla to connect via sftp. Basically just create a new connection, instead of using the default of FTP set it to sftp which is ssh file transfer protocol (as opposed to ftp secure) and login with the same credentials you use to ssh in, and you'll have access to the files you normally have access to when sshed in.

Oh and if the PC you are using the terminal from has no GUI, there's also a command called scp (I think? I'm not in front of a linux system right now to double check) that could work for you. Rsync would work well too, and I actually prefer to use that if there is lot of files as if it fails half way though it wont have to recopy everything.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I need help copying a file from a folder on a linux computer to a flash drive or at least onto the desktop of my linux computer so I can store it on a flash drive.

I am using ssh to access a school computer where the files are saved, I want to copy a file from a folder on the school computer to a folder/desktop/flash drive on the computer I am using now. Is there an easy way to do this? All I need is a way to get said file onto a flash drive.

Thanks.

If you mean from a remote Linux machine to a local Windows desktop, then no, Windows doesn't come with an scp/sftp client by default. If you have access you can install something like WinSCP that will do it pretty easily.
 

ARosch

Member
Apr 12, 2012
75
0
61
I am on a linux machine using ssh to access another linux machine and I just need to copy one file over while I am sshing onto the other machine. Is there not an easy way to do this?
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
I am on a linux machine using ssh to access another linux machine and I just need to copy one file over while I am sshing onto the other machine. Is there not an easy way to do this?

From your local machine, connect to your remote SSH host with SFTP, or if it's not available, SCP. If you're going through multiple layers of SSH connections, go through this process starting from the furthest machine and work your way backwards until the file is on your local machine.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I am on a linux machine using ssh to access another linux machine and I just need to copy one file over while I am sshing onto the other machine. Is there not an easy way to do this?

If you're on a Linux machine then just use the scp command to copy the file from one to the other. Or you can use sftp if you want to interactively browse for it like a command-line ftp client.
 

ARosch

Member
Apr 12, 2012
75
0
61
Can someone give me an example of what this code would look like to copy a file if I was using SFTP?
 

ARosch

Member
Apr 12, 2012
75
0
61
I figured it out, once I connected to the linux computer with sftp all I had to do was type get filename
Then when I exited the sftp session, the file was saved in whatever directory I was using when I connected using sftp.
 

Demo24

Diamond Member
Aug 5, 2004
8,356
9
81
Well the way to do so through the terminal: sudo(most likely need this unless root)

Sudo scp /<path of file you want to copy> /<Destination >

There are some options in the man page that major may not be useful to you. Remember this is all through ssh access so going to the remote comp may mean you need to define that user, ie <user>@<IP address>:/<file destination >

If you get the command right you can do this from your comp without having to log into the remote comp first, course that's only useful if you know exactly what file you need.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Well the way to do so through the terminal: sudo(most likely need this unless root)

Sudo scp /<path of file you want to copy> /<Destination >

There are some options in the man page that major may not be useful to you. Remember this is all through ssh access so going to the remote comp may mean you need to define that user, ie <user>@<IP address>:/<file destination >

If you get the command right you can do this from your comp without having to log into the remote comp first, course that's only useful if you know exactly what file you need.

You don't need sudo/root unless you don't have rights to the file, which seems unlikely in this case.
 

MrColin

Platinum Member
May 21, 2003
2,403
3
81
Another cool trick is to install sshfs. with that you can mount the remote directory locally, ie:
Code:
sshfs user@host:/remote/path /local/mount/point
* /local/mount/point is an empty folder on the local system and can be anything you like, you can use sshfs in your /etc/fstab to mount at boot time as well.
that will allow you to manipulate the files in your file manager as if they were on the local drive. Nautilus (the default file manager for most gnome distros) has a similar gui feature under File > Connect to Server, which allows for ssh and a handful of other protocols.
 
Last edited:
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |