- linux查看操作系统的默认路由命令是什么
答: route
[root@xinsz08-1 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
备注:
Destination: 目标网络或者目标主机。 destination为default(0.0.0.0) 时,表示这个是默认网关。
gateway: 网关地址 ,0.0.0.0表示当前记录对应的destination跟本机在同一个网段,通信时候不经过网关。
genmask: destination字段的网络掩码, destination是主机时,需要设置为255.255.255.255. 是默认路由时,会设置为0.0.0.0
flags: 标记
- U 路由是活动的
- H目标是个主机
- G 需要经过网关
- R回复动态路由产生的表项
- D 由路由的后台程序动态的安装
- M由路由的后台程序修改
- !拒绝路由
[root@xinsz08-1 ~]# ip route
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.18
169.254.0.0/16 dev eth0 scope link metric 1002
default via 192.168.1.1 dev eth0 proto static
-
https使用的端口是什么, 如何查看端口号? https的协议是什么?
HTTPS 默认端口号为443 ,https,基于HTTP协议,通过SSL或者TLS提供加密数据处理,验证对方身份以及保护数据的完整性
[root@xinsz08-1 ~]# netstat -ntulp |grep 443
备注:
- netstat -ntlp 查看所有tcp端口
-
- mysql数据库默认端口号是多少,如何判断服务器上开启了mysql服务?
mysql端口号3306
[root@xinsz08-1 ~]# netstat -tulpn |grep 3306 通过端口查看
[root@xinsz08-63 ~]# ps -ef |grep mysqld 通过进程查看
root 12343 9155 0 21:11 pts/0 00:00:00 grep --color=auto mysqld
- 请写出export LANG=’en_US.UTF8′ 这条命令的作用
en_US.UTF-8:你说英语,你在美国,字符集是utf-8
zh_CN.UTF-8:你说中文,你在中国,字符集是utf-8
- 请写出echo 3 >/proc/sys/vm/drop_caches这条命令的作用?
释放掉被系统Cache占用的数据命令
- 请写出find ./type f -mtime +5 | xargs rm -rf 这条命令的作用个?
找出5天前的文件并删除
- 实时打印出/var/test.log文件的内容
tail -f /var/test.log
- 请写出iptables -A INPUT -p tcp –dport 8080 -j DROP 这条命令的作用?
-A 追加规则
-j 指定对包的处理(DROP,ACCEPT,REJECT)
拒绝8080端口访问
- mysql引擎有哪些,写出2种
InnoDB , MyISAM - linux下负责时钟同步的服务叫什么?
NTP -
linux下访问一个web页面可以用什么命令?
links, wget -
抓取到达服务器eth0的所有包的命令是什么
tcpdump -n -i eth0 host IP -
请写出B段IP地址的掩码
B类IP地址掩码: 255.255.0.0
a段 255.0.0.0 -
请写出lsof -i:8080 |grep log这条命令的作用?
列出打开8080 端口的进程并筛选log进程`
-
在kvm宿主机器上列出当前服务器上所有虚拟机的命令是?
virsh list -all
-
查看docker宿主机服务器上所有容器的命令是?
docker ps -a
-
mysql的账号root, 密码123 ,数据库名字test_db. 端口3310 主机地址 10.10.1.1 请写出备份此数据库的命令
mysql -uroot -p123 -P10.10.1.1:3306 -B test_db > test_db.sql.base
- 查看mysql主从同步的命令是什么?
mysql -e "show slave status /G"查看从机复制状态
- 请写出dmidecode 和dmesg这两个命令的作用
dmidecode查看linux系统下有关硬件的信息
Linux dmesg命令用于显示开机信息。
- 请写出delete from user where name like “u%”; 这条命令的作用
删除用户名以u开头的用户