#查看端口路徑
ll /proc/PID cwd
#安裝lrzsz
yum install lrzsz
yum install -y unzip zip
#查看端口占用
netstat -tlunp | grep 8009
#查看進程打開的文件句柄數
lsof -p 3813|wc -l
#抓包
tcpdump -i em1 udp and host 192.168.2.250
tcpdump -i em1 -w 123.pcap
tcpdump -i em1 -w ./target2.cap
#重啟網絡
systemctl restart network
service network restart
#統計記錄行數
cat Hotpoint_21_190734076_20190712154305.dat |grep 460110718655603 |wc -l
find . -type f |xargs grep 20190712 |grep 460110354629101 |wc -l
#查看端口命令
netstat -an |grep 8080
#查看文件大寫
du -sh xx.txt
df -h
#查看安裝的
yum list installed
yum remove xx
#重啟nginx
service nginx restart
首先利用配置文件啟動nginx。
1.命令:?nginx?-c?/usr/local/nginx/conf/nginx.conf
2.?快速停止或關閉Nginx:nginx -s stop?
3. 正常停止或關閉Nginx:nginx -s quit
4. 配置文件修改重裝載命令:nginx -s reload
#重啟服務:?service nginx restart
#執行pg數據庫腳本
pslq -p 5432 -U ef -d zrt_ef_3
psql -U ef -d dwps2 -p 54321 -f xx.sql
備份數據庫:pg_dump -U ef -d pef? -p 15432? -f? /tmp/pef.sql
tar -zcvf /home/xahot.tar.gz /xahot
tar -zcvf /tmp/etc.tar /etc
1、查看日志 前 n行:
cat 文件名 | head -n 數量
demo:
cat? test.log | head -n 200 # 查看test.log前200行
2、查看日志 尾 n行:
cat 文件名 | tail -n 數量
demo:
cat? test.log | tail -n 200 # 查看test.log倒數200行
3、根據 關鍵詞 查看日志 并返回關鍵詞所在行:
方法一:cat 路徑/文件名 | grep 關鍵詞
demo:
cat? test.log | grep "http" # 返回test.log中包含http的所有行
方法二:grep -i 關鍵詞 路徑/文件名? (與方法一效果相同,不同寫法而已)
demo:
grep -i "http" ./test.log # 返回test.log中包含http的所有行(-i忽略大小寫)