CentOS7 最小化安裝.也有近1個 G...830M
ifconfig 已經(jīng)過時了。
改用“ip addr”和“ip link”命令來查找網(wǎng)卡詳情。
要知道統(tǒng)計數(shù)據(jù)幻碱,可以使用“ip -s link”。
network is not running after installation ...
vi /etc/sysconfig/network-scripts/ifcfg-eth0s3
### edit=> ONBOOT="yes"
systemctl restart network
bash:Bourne Again Shell(/bin/bash)
默認 Shell
```# 注釋```
單行注釋的寫法
```echo $SHELL ```
當前 SHELL 的名稱,例如:/bin/bash
```find / -name hell*```
從根目錄開始,遞歸子目錄,查找文件 hell*.*
軟件包管理:
apt-get:Ubuntu.軟件包管理工具
brew:macOS.apt-get...
yum:RedHat.apt-get...
yum -y install net-tools
yum -y install docker
yum -y install go
systemctl 是系統(tǒng)服務管理器命令,它實際上將 service 和 chkconfig 這兩個命令組合到一起鸭丛。
任務 舊指令 新指令
使某服務自動啟動 chkconfig –level 3 httpd on systemctl enable httpd.service
使某服務不自動啟動 chkconfig –level 3 httpd off systemctl disable httpd.service
檢查服務狀態(tài) service httpd status systemctl status httpd.service (服務詳細信息) systemctl is-active httpd.service (僅顯示是否 Active)
顯示所有已啟動的服務 chkconfig –list systemctl list-units –type=service
啟動某服務 service httpd start systemctl start httpd.service
停止某服務 service httpd stop systemctl stop httpd.service
重啟某服務 service httpd restart systemctl restart httpd.service
//centos 查看所有運行中的服務的詳細信息命令:
netstat -tunpl
ps -aux | grep YourKeyWordToSearch
Q:how to know OS Name?
lsb_release -a
cat /etc/os-release
cat /etc/redhat-release
Q:How to show disk space?
A:```df``` NOT ```dd```.
Q:df only show one disk. how to show another bigger disk?
A:```fdisk -l```
Q:如何限制一個命令執(zhí)行的時間?
```timeout 1s ls```
SSH.DSA
---
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
dsa is not supported by default.
To compatible dsa, you need to add below line:
```PubkeyAcceptedKeyTypes +ssh-dss```
into your ~/.ssh/config
cat ~/.ssh/config
PubkeyAcceptedKeyTypes +ssh-dss
DNS:
---
//to set dns:
sudo su -
nmcli con mod enp4s0 ipv4.dns "202.99.192.66 202.99.192.68 8.8.4.4 8.8.8.8"
nmcli con up enp4s0
nmcli dev show enp4s0
# 在shell 中,將某個文件復制成一百個文件
for (( i=1; i<=100; i++ ))
do
cp bg.jpg bg$i.jpg
done