文字設(shè)定:
chmod ug + w o - x test.txt
5、查看用戶 用戶組
cat /etc/group
cat /etc/passwd
6、抓包命令
tcpdump -s o -i any port 18350 -V -W data.cap
strings data.cap >abc.txt
less abc.txt
7、查看系統(tǒng)日志 linux 重啟信息 (最近誰(shuí)登陸過(guò)在log下面的其他目錄)
less /var/log/messages
8、
df -h 磁盤使用率
free 內(nèi)存使用率
top cpu 使用率
9、查看端口監(jiān)聽(tīng)情況
netstat -an|grep 18350
lsof -i:8542
10、查看進(jìn)程
ps -ef|grep java
ps -fu dm (dm為應(yīng)用名稱)
11、新建用戶和用戶組
groupadd -g 202 kafkatodbgroup
echo
passwd%20kafkatodb
12、tar%20包命令
tar%20-zcvf%20config.tar.gz%20%20config/
tar%20-zxvf%20config.tar.gz
13、如果一個(gè)單板你能ping通%20但ssh連接不上:
cat%20/etc/hosts.deny%20%20刪除你的ip
cat%20/etc/hosts.allow%20%20加上你的ip
14、windows文件轉(zhuǎn)為linux文件
dos2unix xxx.sh
執(zhí)行shell文件時(shí)linux命令,每行都報(bào) commond not found時(shí) 就可能是這個(gè)問(wèn)題。
15、 查看所有shells
cat /etc/shells
echo &SHELL 查看當(dāng)前用戶下的shell 若系統(tǒng)下沒(méi)有安裝cshlinux命令,可以yum install csh 進(jìn)行安裝。
16、在文件里層層查找先要的內(nèi)容
grep "bobe" *.txt | grep "20180512" |grep "cn >> result.txt
17、查看目錄下文件的數(shù)量
ll | wc -l
18、root用戶下修改單板時(shí)間