昨天回顧
vi的使用操作
- 編輯模式
esc 退出
crtl+→命令行向右移動(dòng)一個(gè)單詞
ctrl+←命令行向左移動(dòng)一個(gè)單詞 - 命令行模式
0,^移動(dòng)到行首
$ 移動(dòng)到行尾
a 光標(biāo)之后插入,進(jìn)入編輯模式
A 行尾插入,進(jìn)入編輯模式
o 文件的下一行插入,進(jìn)入編輯模式
O文件的上一行插入娩缰,進(jìn)入編輯模式
cc 清空當(dāng)前行進(jìn)入編輯模式
C 清除光標(biāo)到行尾進(jìn)入編輯模式
r 把光標(biāo)所在字符做更改
R 把光標(biāo)右邊做的字符串做更改
yy復(fù)制一行
nyy復(fù)制多行
dd 剪貼
ndd 多行剪貼
p(小寫(xiě))粘貼到光標(biāo)下方
P(大寫(xiě))粘貼到光標(biāo)上方
- 底行模式
: ? \ 進(jìn)入 esc 退出
wq 保存退出
q 退出
嵌器!強(qiáng)制
\向下搜索
沦寂?向上搜索
今天總結(jié)
目錄的結(jié)構(gòu)說(shuō)明
linux目錄說(shuō)明.jpg
系統(tǒng)命令
1 .mount
mount 掛載
-t 選擇文件系統(tǒng)
-o 選擇參數(shù)掛載
2 .df
df 顯示文件系統(tǒng)磁盤(pán)的使用大小
df - report file system disk space usage
-h 以人類(lèi)可讀方式顯示
-T 顯示文件系統(tǒng)
-i 顯示inode節(jié)點(diǎn)使用情況
-k 顯示block使用情況
[root@oldboy63 ~]# df -Thi
Filesystem Type Inodes IUsed IFree IUse% Mounted on
/dev/sda3 xfs 9.2M 58K 9.2M 1% /
devtmpfs devtmpfs 119K 376 119K 1% /dev
tmpfs tmpfs 122K 1 122K 1% /dev/shm
tmpfs tmpfs 122K 712 121K 1% /run
tmpfs tmpfs 122K 16 122K 1% /sys/fs/cgroup
/dev/sda1 xfs 100K 326 100K 1% /boot
tmpfs tmpfs 122K 1 122K 1% /run/user/0
3.fdisk
fdisk 常規(guī)分區(qū)工具
fdisk - manipulate disk partition table
-l 如果fdisk后面不接設(shè)備,則按/proc/partitions
-l List the partition tables for the specified devices and then exit. If no devices are given, those men‐tioned in /proc/partitions (if that exists) are used.
[root@oldboy63 ~]# cat /proc/partitions
major minor #blocks name
8 0 20971520 sda
8 1 204800 sda1
8 2 1536000 sda2
8 3 19229696 sda3
11 0 4481024 sr0
[root@oldboy63 ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d569e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 3483647 1536000 82 Linux swap / Solaris
/dev/sda3 3483648 41943039 19229696 83 Linux
[root@oldboy63 ~]# fdisk -l /dev/sda
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d569e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 3483647 1536000 82 Linux swap / Solaris
/dev/sda3 3483648 41943039 19229696 83 Linux
linux系統(tǒng)中重要的文件
- 網(wǎng)卡配置文件
[root@oldboy63 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet 以太網(wǎng)
BOOTPROTO=none none表靜態(tài)ip
NAME=eth0 表網(wǎng)卡名字
UUID=7d68063c-6084-4710-bf9f-8382c0deb154 網(wǎng)卡的UUID
DEVICE=eth0 網(wǎng)卡的設(shè)備名字
ONBOOT=yes 開(kāi)機(jī)自啟動(dòng)
IPADDR=10.0.0.200 ip地址
PREFIX=24 子網(wǎng)掩碼
GATEWAY=10.0.0.2 網(wǎng)關(guān)
DNS1=8.8.8.8 DNS域名解析服務(wù)器
DNS2=180.76.76.76 DNS域名解析服務(wù)器
- DNS解析文件
[root@oldboy63 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search com
nameserver 8.8.8.8
nameserver 180.76.76.76
===================================================================================
此配置修改揭蜒,即生效横浑。網(wǎng)卡重啟,網(wǎng)卡里面的配置文件會(huì)覆蓋此配置文件
- 本地域名解析文件
[root@oldboy63 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
==================================================================================
此配置文件的域名解析忌锯,常用與局域網(wǎng)內(nèi)部測(cè)試使用伪嫁。優(yōu)先級(jí)要高于域名解析服務(wù)器
擴(kuò)展
修改網(wǎng)卡配置文件
centos6: setup
vi/vim /etc/sysconfig/network-scripts/ifcfg-eth0
centos7: nmtui=====>systemctl restart NetManager======》systemctl restart network
vi/vim /etc/sysconfig/network-scripts/ifcfg-eth0
centos7如何修改網(wǎng)卡名字
1 . 修改網(wǎng)卡配置文件中的信息
1.png
2 .修改配置文件名字
ls /etc/sysconfig/network-scripts/ifcfg-eth0
3 .修改系統(tǒng)中網(wǎng)卡的信息
3.png
- 加載配置文件
[root@oldboy63 default]# grub2-mkconfig -o /boot/grub2/grub.cfg
5 .重啟
reboot