1、常見的幾種查看server.log的文件內(nèi)容的方式?
Linux查看日志文件內(nèi)容命令:tail、cat、head
2、編輯istester.conf文件,并查看文件前10行內(nèi)容和后10行內(nèi)容?
vi istester.conf
#前10行
head -n 10 istester.conf
#后10行
tail -n 10 istester.conf
3、刪除istester.conf文件?
rm -rf istester.conf
4、刪除istester.com文件夾?
rm? -rf istester.com
(PS:實際工作中,【rm】命令建議少用,畢竟很危險,可以用【mv】來代替,移動需要刪除到的文件,到【垃圾區(qū)】,定期自動清理。)
5、如何直接下載某個文件?
wget http://download.redis.io/releases/redis-3.2.0.tar.gz
或者用 curl -O http://download.redis.io/releases/redis-3.2.0.ter.gz
6、把當(dāng)前文件istester.conf拷貝到目標(biāo)服務(wù)器112.74.75.239服務(wù)器的 /ido/xu/文件夾下?
scp ./istester.conf root@112.74.75.239:/ido/xu/
7、把當(dāng)前文件夾istester.com拷貝到另外一臺目標(biāo)服務(wù)器112.74.75.239服務(wù)器的 /ido/xu文件夾下?
scp -r ./istester.com root@112.74.75.239:/ido/xu/
8、查看后臺所有Java進程
ps -ef | grep java
9、查看80端口是否被占用?
netstat -nltp | grep 80
10、結(jié)束后臺某進程?
kill PID? ?或者 kill -9 PID
11、將istester.conf文件改為可執(zhí)行權(quán)限?
chmod u + x istester.conf 或者? ?chmod 755 istester.conf
12、更改Linux服務(wù)器系統(tǒng)時間為 2018/04/09 22:22
date -s 日期/時間
date -s 2018/04/09
date -s 22:22
13、實時看最新的100行Log?
tail -100f istester.log
14、Linux服務(wù)器,網(wǎng)絡(luò)時間同步?
①、尋找一個網(wǎng)絡(luò)時間服務(wù)器,比如一些國家授時中心
微軟公司授時主機(美國)
time.windows.com
臺警大授時中心(臺灣)
asia.pool.ntp.org
中科院授時中心(西安)
210.72.145.44
網(wǎng)通授時中心(北京)
219.158.14.130
②、怎樣去同步授時中心的時間?
ntpdate asia.pool.ntp.org【此命令就是去同步授時中心的時間】