linux學習網站:https://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.htmlhtml
19.dhclient eth0 使網卡生效,靜態ip設置生效,eth0爲網卡名linux
18. du -s * | sort -nr 文件夾按大小排序windows
17 xargs使用 ps -ef|grep "zabbix_agentd"|grep -v "grep"|awk '{print $2}'|xargs kill -9工具
16.使用xftp上傳或者下載文件學習
put:將windows傳入linux,put --help會調出文件控制器方便選擇網站
get: 將linux資源下載到windowsspa
15.if ----elsenuxt
a.)注意[與$1x之間有空格,不然會被當成一個 ,與等號之間都要有空格3d
b.)這個x爲標記碼,防止$1等於空日誌
if [ x$1 == x"ab" ]; then //不等於空則表達式爲 [ x$1 != x ] echo "you had enter ab" elif [ $1x == "cd"x ]; then echo "you had enter cd" else echo "you had enter unexpected word" fi
14.參數傳遞獲取
13.sed /匹配文本/要替換的文本/g(全局,不加g只匹配一個) file(文件名)
12. route -n 查看對應網卡配置的網關
route add default gw 192.168.1.1 eth0(網卡名) 添加對應網卡網關
解決的問題:Network is unreachable.
上面的問題也多是沒有配置DNS致使。
以此倒敘:
1.awk命令 '{print $5}' ====》輸出第5列的數據,已空格爲分隔爲1列
ps:
2.head -5 前5行
head -n -2 負數時不要最後兩行
3.tail -5 後5行 tail -f xxx.log 能夠實時查看日誌
去除第一行的方法:
tail -n +2 從第2行開始
tail -n 2 只展現末尾2行
4.wc -l linux句柄查看
5.du 文件夾/文件 查看文件大小
6.sort -nr n爲數值大小,r是倒序
7.命令結果輸出到文件
ls > ls.txt 會覆蓋以前內容
ls >> ls.txt 會記錄到文件末尾
8.pwd 顯示當前文件路徑
9.env 顯示環境變量
10.echo $PATH 輸出變量
11.工具類命令 http://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/crontab.html