天天看點

學習python,第四天

echo 内容 >a 将内容放到檔案裡 ls -lh > a 會覆寫原有内容

echo >> a 追加到末尾 不會覆寫原有内容

|管道 ls -lha ~ | more

shutdown關機 shutdown now立刻關機 shutdown -r重新開機 shutdown -c取消

shutdown 10:00十點關機 shutdown +10十分鐘後關機

ifconfig檢視配置網卡資訊 ifconfig | grep inet 檢視對用的ip

ping檢測目标ip位址連接配接是否正常 ping 127.0.0.1檢查本地網卡是否正常

ssh -p port [email protected] user是使用者名 remote是ip port預設值是22

ssh -p 22 python(遠端使用者名)@ip位址

sudo超級權限

windows安裝shh

putty www.chiark.greenend.org.uk/~sgtatham/putty/latest.heml

xshell xshellcn.com

scp和ssh不同是的大寫的P

scp複制檔案

scp -P 22 源檔案 目标檔案([email protected]:)

01.py [email protected]:Desktop/01.py

scp複制檔案夾

scp -r 檔案夾名 [email protected]:Desktop

windows下載下傳 www.filezlla.cn/download/client 端口号是21

免密碼登入模式 ssh-keygen一直回車

ssh-copy-id 使用者名@ip位址

配置别名友善使用

在~/.ssh/config裡添加一個内容

Host mac(别名)

HostName 172.16.140.1(ip)

User itheima(使用者名)

Port 22(端口)