安裝centos7
1.在VMware中建立空白虛擬機(jī)
2.編輯虛擬機(jī)
3.選擇光盤鏡像作為啟動(dòng)源
4.時(shí)區(qū),語(yǔ)言,分區(qū)等配置,root用戶密碼設(shè)置,普通用戶設(shè)置
5./boot 系統(tǒng)引導(dǎo)程序,swap虛擬交換分區(qū),/proc虛擬文件系統(tǒng)(反映進(jìn)程等的實(shí)時(shí)狀態(tài)),/tmp臨時(shí)文件,/usr系統(tǒng)文件,/var經(jīng)常發(fā)生變化的文件(數(shù)據(jù)庫(kù)文件等)
服務(wù)器介紹
三種服務(wù)器類型:


云平臺(tái)的使用
阿里云,騰訊云等的使用。
阿里云https://www.aliyun.com/?utm_content=se_1000301881,
騰訊云https://cloud.tencent.com/fromSource=gwzcw.2212127.2212127.2212127&utm_medium=cpd&utm_id=gwzcw.2212127.2212127.2212127
在其各個(gè)官網(wǎng)上進(jìn)行操作,選擇服務(wù)器規(guī)格(內(nèi)存,核數(shù)等),系統(tǒng)(Windows,linux等)。
基本指令
su---切換用戶
ls---查看目錄下包含的
cat---查看文件內(nèi)容
head--查看文件前10行內(nèi)容(-n)
tail----查看文件末尾10行內(nèi)容(-n)
cd---更改目錄
touch---創(chuàng)建文件
mkdir---創(chuàng)建文件夾
rm---刪除文件或目錄(-r 遞歸)
mv---移動(dòng)文件同時(shí)改名
init 0--關(guān)機(jī)
init 6--重啟
locale--查看語(yǔ)系(編碼格式:UTF-8,GBK等)
shutdown -h now---立刻關(guān)機(jī)(參數(shù)可為具體時(shí)間)
shutdown -r now---立即重啟()
sync; sync; sync; reboot---同步數(shù)據(jù)后重啟
ls
ls -l #顯示詳細(xì)信息
ls -h #顯示容量大小
ls -d #查看自己
ls -t #按時(shí)間排序
ls -r #反向排序
ls -a #查看全部文件,包括隱藏文件
ls -i #列出inode的位置
ls -R #與子目錄內(nèi)容一起列出來(lái)
ls -S #按文件容量大小排序,大于 4096 字節(jié)才有效
ls --full-time #完整的呈現(xiàn)文件的修改時(shí)間
ls -1 #每行顯示一個(gè)文件或目錄名
選項(xiàng)可以組合:
例如
ls -lid #查看自己的詳細(xì)信息 以及自己的inode位置
cd
cd ~ #回到自己的家目錄
cd ~ rourou #回到rourou的家目錄
cd - #回到上次離開(kāi)的目錄
cd .. #到上一層目錄
date
[root@hostname ~]# date
Mon Jul 22 22:29:42 CST 2019
[root@hostname ~]# date +"%Y-%m-%d"
2019-07-19

日歷:
cal #可以指定年,月
幫助
ls --help #查看幫助
man ls #查看說(shuō)明文檔
權(quán)限
linux里一切皆文件
關(guān)系有三種:user,group,other
/etc/passwd 保存了用戶的相關(guān)信息
/etc/shadow 保存了用戶的密碼等信息
/etc/group 保存了組的相關(guān)信息

修改關(guān)系
chown
[root@localhost a]# ll a.txt
-rw-r--r--. 1 root root 0 Jul 22 16:00 a.txt
[root@localhost a]# chown rourou a.txt
[root@localhost a]# ll a.txt
-rw-r--r--. 1 rourou root 0 Jul 22 16:00 a.txt
[root@localhost a]# chown :rourou a.txt
[root@localhost a]# ll a.txt
-rw-r--r--. 1 rourou rourou 0 Jul 22 16:00 a.txt
[root@localhost a]# chown root:root a.txt
[root@localhost a]# ll a.txt
-rw-r--r--. 1 root root 0 Jul 22 16:00 a.txt
修改權(quán)限
符號(hào)方式
對(duì)象 賦值 權(quán)限類型
U + r
Chmod g - w
o =(覆蓋) x
a(所有的)
數(shù)字方式
r=4
w=2
x=1
[root@localhost a]# ll a.txt
-rw-r--r--. 1 root root 0 Jul 22 16:00 a.txt
[root@localhost a]# chmod 166 a.txt
[root@localhost a]# ll a.txt
---xrw-rw-. 1 root root 0 Jul 22 16:00 a.txt
文件的r : 查看文件內(nèi)容
文件的x : 執(zhí)行該文件
目錄的r :查看該目錄下的文件和目錄
目錄的x: 允許使用該目錄
inode
linux的存儲(chǔ)方式所致,linux的文件和文件夾存儲(chǔ)是通過(guò)索引完成的,inode相當(dāng)于索引,但是又不同于索引,inode中包含權(quán)限,user,group以及對(duì)應(yīng)的clock號(hào),clock中包含對(duì)應(yīng)數(shù)據(jù)或是其下一級(jí)目錄的inode號(hào),以此類推。

權(quán)限掩碼
umask -S #從創(chuàng)建時(shí)減去umask的權(quán)限得到最后的權(quán)限
