Linux 命令
查询占用端口的程序
netstat -ano | findstr 21868
查询占用端口的程序
netstat -ano | findstr 21868
ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
ssh -L 5901:127.0.0.1:5901 -N -f user@remote.host
The -f
option tells the ssh
command to run in the background and -N
not to execute a remote command. We are using localhost
because the VNC and the SSH server are running on the same host.
ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
GatewayPorts yes
允许从外部访问远程主机转发端口
ssh -R 8080:127.0.0.1:3000 -N -f user@remote.host
The command above will make the ssh server listen on port 8080, and tunnel all traffic from this port to your local machine on port 3000.
https://linuxize.com/post/how-to-setup-ssh-tunneling/
mv -t DESTINATION file1 file2 file3
cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/
https://askubuntu.com/questions/214560/how-to-move-multiple-files-at-once-to-a-specific-destination-directory
https://askubuntu.com/questions/327282/copying-multiple-specific-files-from-one-folder-to-another
/etc/apt/apt.conf.d/proxy.conf
Acquire {
HTTP::proxy "http://proxy_server:port/";
HTTPS::proxy "http://proxy_server:port/";
}
https://linuxiac.com/how-to-use-apt-with-proxy/
下面是 man apt-get 的摘录。使用 upgrade 时应遵守以下规则:在任何情况下都不得删除当前已安装的软件包,也不得检索和安装尚未安装的软件包。如果这对你很重要,那就用 apt-get upgrade
。如果你想让一切 "正常运行",你可能需要使用apt-get dist-upgrade
来确保依赖关系得到解决。
upgrade 用于从/etc/apt/sources.list 列举的源中安装系统当前安装的所有软件包的最新版本。当前安装的软件包如果有新版本可用,则会被检索和升级;在任何情况下,当前安装的软件包都不会被移除,尚未安装的软件包也不会被检索和安装。当前已安装的软件包的新版本,如果不能在不改变其他软件包安装状态的情况下升级,则会保留其当前版本。必须先进行更新,以便 apt-get 知道新版本的软件包可用。
除了执行升级功能外,dist-upgrade 还能智能地处理与新版本软件包的依赖关系变化;apt-get 有一个 "智能 "的冲突解决系统,它会尝试升级最重要的软件包,而命令可能会删除某些软件包。/etc/apt/sources.list文件包含一个位置列表,可以从中获取所需的软件包文件。另请参阅 apt_preferences(5),了解覆盖个别软件包常规设置的机制。