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