linux 常用操作

2021-10-19 10:06:41 字數 750 閱讀 9341

使用 ip a s 檢視ip得相關資訊

設定靜態ip位址要修改網絡卡配置檔案 vi /etc/sysconfig/network-scripts/ifcfg-ens32 (最後乙個為網絡卡名稱)

(1)bootproto=static

(2)onboot=yes

(3)在最後加上幾行,ip位址、子網掩碼、閘道器、dns伺服器

ipaddr=

192.168

.1.160

netmask=

255.255

.255

.0gateway=

192.168

.1.2 #預設閘道器

dns1=

119.29

.29.29

dns2=

8.8.8

.8

(4)重啟網路服務

systemctl restart network

Linux常用操作

顯示檔案內容more less head tail cat pg 分頁 檢視檔案cat 檔案拼接合併 cat 檔案1 檔案2 輸出檔案 查詢檔案內容grep 選項 字串 檔案列表 對檔案內容排序sort 比較檔案內容comm 排好序的檔案 diff b忽略空格 b忽略空行 i忽略大小寫 結果中 第乙...

Linux常用操作

mount t cifs o username password nounix,noserverino mount掛載點 mount t cifs o username domain gid 0 uid 0 nounix,noserverino mount掛載點 export ld library ...

Linux常用操作

etc 系統配置 bin 系統程式 dev 裝置檔案,如cd rom,網路藉口,usb等 lib 共享的庫檔案 usr 使用者共享的檔案,如幫助檔案 var 大小可變檔案,如日誌 ls 檢視目錄下的檔案 ls a 檢視目錄下的所有檔案 包括隱藏檔案 ls l 檢視目錄下檔案的詳細資訊 cd 切換當前...