This is an easy way to set up a web-server. This command will make the entire folder, from where you issue the command, available on port If you can't have an interactive shell it might be risky to start listening on a port, since it could be that the attacking-machine is unable to connect. So you are left hanging and can't do ctr-c because that will kill your session. If you have access to a ftp-client to can of course just use that.
In the example below, the receiver will store the file linuxhint. You also can implement the command pv to show the progress in file transfers. On the receiving side, add a pipe followed by the command pv used to monitor the progress of data through a pipe and the inbound file specification. Pv output can be edited to change the file units; check the man page of this command to show the progress in other units than bytes. On the receiver device, type the command below, replacing linuxhint2 for the name of the compressed directory you want to receive from this device.
On the sender device, run the command below, replacing linuxhint2 with the name of the directory you want to compress and send. Also, replace the IP The server is no more! To run a persistent static server without typing anything in, write your HTTP response to a file like index.
Use pv --rate-limit 10 to read the file at 10 bytes per second:. With Vidrio. Tagged programming , unix , networking. You can always edit your questions and long copy-pastes don't look very well in comments, in similar cases it is better if you edit them into your question.
And, if you have another question, you can ask it in a new question, this is not a problem here only if you ask the same thing twice. Keith Keith 4, 5 5 gold badges 33 33 silver badges 46 46 bronze badges.
This worked for me. Graham Leggett Graham Leggett 5 5 silver badges 15 15 bronze badges. This is capital "-C" for linux as something to add to this answer and without it the above suggestions won't work. Test it out locally with python3 http. On one shell, launch a local file server: python3 -m http. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
0コメント