Share files in the current folder as HTTP
$ Python-M simplehttpserver
This command starts the simplehttpserver module of Python.
This command is probably the simplest method for cross-platform file transfer.
After the command is executed, the HTTP service will be opened on port 8000 of the Local Machine and opened in browsers of other machines that can access the local machine.
Ttp: // ip: 8000 open a directory list and click to download.
Start a web server using the current directory as the root directory. Because the default port is 8000, and to avoid resetting the port forwarding on the router, I specified port 9393:
Python-M simplehttpserver 9393
Success, cool!
To facilitate future use, I wrote an alias program and added it to my. bash_profile.
Alias HTTP = "Python-M simplehttpserver"
Later, I want to share more files. I only need to CD them to the relevant directory and execute HTTP or HTTP 9393.
Official reference
Source Code