LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2017, 01:32 PM   #1
kmzach23
LQ Newbie
 
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
How to save a file from a linux server onto my pc?


In my programming class, we have to submit assignments to the linux class server. I have already submitted an assignment and I want to copy the file from the class server and save it to my pc to make sure everything is correct.

The assignment is in the directory:

/~teacher/data/csis296/asst0/coin.cpp

and I want to copy it to my desktop:

C:\Users\Owner\Desktop

I tried cp ~teacher/data/csis296/asst0/coin.cpp C:\Users\Owner\Desktop
but it doesn't seem to do anything. Any help would be appreciated.
 
Old 07-01-2017, 01:39 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,438

Rep: Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161Reputation: 2161
It's very probable you have an underprivileged account, and may not have read access. Do they want you & your mates reading the class swat's homework & copying it? Get a usb drive, back up to that, and ask your lecturer for a copy.

I would also point out that
Code:
cp ~teacher/data/csis296/asst0/coin.cpp C:\Users\Owner\Desktop
is using a unix command (cp) and an M$ windows directory on the same line, which is dim. Don't mix '/' and '\' for directories either. What OS are you in?

Last edited by business_kid; 07-01-2017 at 01:44 PM.
 
Old 07-02-2017, 06:59 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
If you can view the file from your desktop you could as a last resort take screen caps of the code.

$ scrot

If linux to linux and you have a shell with read access to the file.

(remote machine sending, AFTER receiving is running)
$ nc <IP of receiving machine> 5900 -q 5 < file_you_want.ext

(receiving machine, listens and waits)
$ nc -l -w 300 -p 5900 > file_you_get.ext

Where 5900 is a port and needs to NOT be blocked by firewalls and such. Could technically be any port that the user has access to (typically > 1024 ports). As long as there's nothing else using that port, in the example 5900 is common for VNC type things. And -w is the number of seconds to wait, where 300 is 60 * 5 or 5 minutes. The -q option tells it to exit when complete.
 
Old 07-02-2017, 07:41 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,715

Rep: Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593Reputation: 5593
Welcome to LinuxQuestions.

Have you asked your instructor?

How do you submit your assignments to the server?
Do you write your code on lab computers or the server itself?

From your post it appears that you might be connecting to the server with your PC using PuTTY or other client application.

If so PuTTY by itself only allows you to run commands on the server and does not allow you to save files to the PC. PuTTY does have other command line utilities i.e. pscp.exe and psftp.exe where you can download files or there are GUI utilities like filezilla and winscp assuming you can install other applications to your PC.
 
1 members found this post helpful.
Old 07-02-2017, 09:10 AM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Provided you have access to the server/file on the Linux machine you might try installing WinSCP on your Windows PC.https://sourceforge.net/projects/winscp/ Makes file transfer very easy.

Ken
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create and Save File Server Shortcut carlosinfl Linux - Desktop 1 08-22-2011 02:09 PM
Firefox "Save File" dialog for .otf font file on 1 server and not on another HighLQ Linux - Server 4 05-28-2010 07:59 AM
Server NOOB - how do i save a file after VI? mitchell7man Linux - Server 8 05-03-2007 11:20 AM
Is there a way to find the current mbps my server is pushing and then save to a file? abefroman Linux - Networking 1 10-16-2006 05:16 AM
Save mail on a samba file server kwellis Linux - Software 1 09-26-2006 04:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration