Linux常用命令
发表于更新于
字数总计:266阅读时长:1分钟阅读量: 长沙
通用命令
查看文件大小
杀死进程
1 2 3 4 5 6 7
| killall nginx
yum install psmisc
yum search killall
|
ssh连接
添加用户
持续输出(用于日志)
上传文件到远程主机
1
| scp a.jpg index.html root@192.168.10.41:/var/www/html
|
网络相关
常用操作
1 2 3 4 5 6 7 8
| cat /etc/hosts
/etc/resolv.conf
/etc/sysconfig/network-script/ifcfg-<interface-name>
|
设置静态ip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
BOOTPROTO="static" ONBOOT="yes" IPADDR=192.168.100.109 NETMASK=255.255.255.0 GATEWAY=192.168.100.254
/etc/init.d/network restart
service network restart
nameserver 114.114.114.114 nameserver 8.8.8.8
|
添加/删除一个子网卡
1 2 3 4 5
| ifconfig ens33:1 192.168.10.52/24 up
ifconfig ens33:1 down
|
Network is unreachable
https://dev.twsiyuan.com/2018/02/linux-network-unreachable.html
1 2
| [root@localhost ~]$ ifup ens33 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
|