1. 下载putty
下载地址:https://putty.en.softonic.com/
下载完后安装,很小,我就直接默认c盘了:
要把上图路径加入环境变量,一般来说安装的时候已经默认加进去了:
2. 使用pscp进行文件互传
(1)windows传linux服务器:
pscp -P <ssh端口号> <本地文件路径> <linux用户名>@<ip地址>:<linux路径>
例:
pscp -P 111 C:\Users\lakuite\Desktop\test.txt user@192.168.1.1:/tmp
如果服务器没有修改端口号,默认为22,则不需要 -P <端口号>
如果路径中有中文,也不需要单引号,直接写即可。
(2) linux传windows:
windows打开cmd:
pscp -P 111 user@192.168.1.1:/tmp/test.txt C:\Users\lakuite\Desktop\test.txt
3. 后台运行python程序并输出日志
来源:https://www.jianshu.com/p/deca281a194f
nohup python -u test.py >test.log 2>&1 &
nohup 以及命令结尾的& :代表后台运行
-u: python的输出有缓冲,导致test.log并不能够马上看到输出,-u使得python不启用缓冲
>test.log: 标准输出被重定向到一个叫做test.log 的文件中,前面省略了1
2>&1:所有的标准输出和错误输出都将被重定向到一个叫做test.log 的文件中
查看日志命令:
tail -f test.log 实时查看日志文件
cat test.log 查看全部输出
4. ubuntu压缩和解压缩
来源:https://blog.51cto.com/4563839/2147506
https://baijiahao.baidu.com/s?id=1650170269926650594&wfr=spider&for=pc
https://baijiahao.baidu.com/s?id=1640987338729787489&wfr=spider&for=pc
######### zip
zip -r fn.zip fn # 将fn文件夹压缩为fn.zip
zip -r fn.zip fn1 fn2.txt # 将fn1文件夹和fn2.txt文件一起压缩为fn.zip
unzip fn.zip # 解压到当前目录
unzip fn.zip -d unzipped_directory # 解压到对应目录下
unzip -l fn.zip # 不解压仅查看
######### rar
unrar x fn.rar
######### tar
tar -cvf 123.tar file1 dir1 # 将文件file1和文件夹dir1压缩成一个123.tar文件
tar -zxvf file.tar.gz # 解压缩到当前目录