伺服器命令列常用的指令

2021-10-10 06:43:08 字數 861 閱讀 4514

1.進入伺服器

ssh  -p   ***xx(埠號)  ***@202.119.84.91(使用者名稱@ip位址)
2.檢視當前所在路徑裡包含的檔案

ls
3.查詢絕對路徑

pwd
4.編輯乙個python檔案

1.開啟檔案

vim demo.py

2.編輯

輸 i3.終止

輸 esc

4.儲存並退出

輸 :wq 最後enter

5 不儲存退出

輸 :q 然後enter

6.強制退出

輸 :q !

5.執行python檔案

python demo.py
6.建乙個shell指令碼跑python 程式

1.新建乙個shell指令碼

vim test.sh

2.進入shell編輯介面

輸 i 進行編輯

3.編輯

#!/bin/sh

python ./././demo.py

4.儲存並退出

輸 :wq 然後enter

5.重回命令列

chmod u+x test.sh

6.執行shell指令碼

./job.sh

cmd命令列常用指令

新建資料夾和檔案 cd 返回上一級 md test 新建test資料夾 md d test my d盤下新建資料夾 cd test 進入test資料夾 cd.cc.txt 新建cc.txt檔案 dir 列出資料夾下所有檔案及資料夾 刪除資料夾和檔案 cd test 進入test資料夾 dir 檢視所...

ipmitool 命令列重啟伺服器

我們所有得伺服器都有乙個console 口,當伺服器到了機房後,我們只需要將這個console 口連上線放通網路,我們就可以實現遠端管理這台server 不需要頻繁得去機房操作,這個console ip 也被叫為bmc ip 我們重啟server 我知道得是有三種方式 1.機房物理重啟 2.cons...

每次登入伺服器命令列pip conda 命令出錯

參考 變數的問題,就再次更新.bashrc檔案,結果確實是這個問題。解決方案 每次登入是都更新一次環境變數檔案 設定.profile檔案 vim profile更改內容 if running bash if n bash version then include bashrc if it exist...