1. 后臺執(zhí)行程序
nohup Your command &
# 后臺執(zhí)行命令,并將結(jié)果輸出到指定文件
nohup python test.py >>output &

image.png
該命令會顯示后臺執(zhí)行的命令的
[jobno] pid
例如 [1] 4376
查看該進程
ps -ef | grep pid(如4376)
所有的輸出將保存到nohup.out
查看該文件:
view nohup.out
#view 會調(diào)用 vi/vim打開文件
殺死該進程
kill pid(如4376)
2.獲取文件夾權限
sudo chown 用戶名 文件夾路徑/ -R
3.遠程連接另一臺Ubuntu 服務并傳輸文件
#從本地到服務器
scp -r 本地文件路徑 服務器賬號名@服務器Ip:想要保存的路徑
scp -P 端口號 -r 本地文件路徑 服務器賬號名@服務器Ip:想要保存的路徑
#從服務器到本地
scp -r 服務器賬號名@服務器Ip:文件路徑 本地保存路徑
4.壓縮命令
# 如果沒有安裝zip ,需要
sudo apt install zip
# 將test文件夾下的文件壓縮為test.zip
zip -r test.zip test/
# 解壓縮
unzip test.zip
5. Vi/Vim 命令
保存退出:
先按 esc,然后輸入:, 然后輸入wq
不保存退出:
先按esc, 然后輸入 :, 然后輸入q
6. Firefox火狐瀏覽器驅(qū)動網(wǎng)址(Selenium爬蟲用)
https://github.com/mozilla/geckodriver/releases
7.使用國內(nèi)鏡像進行pip 安裝
最近在金山云安裝python包,總是遇到read time out的報錯,應該是和網(wǎng)絡有關,百度后,發(fā)現(xiàn),可以通過切換鏡像源結(jié)絕
pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ 指定Python包名,如numpy
參考
https://blog.csdn.net/qiaochao911/article/details/16800561
http://www.itdecent.cn/p/bdcbe7c8778d
https://blog.csdn.net/xd_wjc/article/details/84836570
https://blog.csdn.net/weixin_39873397/article/details/83020670
http://www.itdecent.cn/p/c0b4d7d5dfda
http://www.itdecent.cn/p/173f925b7de7
https://jingyan.baidu.com/article/495ba8410ff14d38b30ede01.html
https://github.com/jlevy/the-art-of-command-line/blob/master/README-zh.md
https://www.cnblogs.com/angdh/p/11319785.html