# 输出地图列表
- 进入地图目录
cd /home/steam/csgoserver/csgo/maps
列出目录下的地图名,去掉.bsp 后缀,保存至 maplist 文件
ls *.bsp cut -d "." -f 1 > maplist
-d "."
表示以.
分割字符串,-f 1
表示取分割出的第一段下载当前的全球图列表
wget https://maps.global-api.com/mapcycles/gokz.txt
为了之后的正则匹配操作,将 gokz.txt
的换行符转换为 UNIX 标准
sudo apt-get install dos2unix | |
dos2unix gokz.txt |
# 地图过滤
列出本地的所有的地图名,然后和 GOKZ 地图站的 maplist 进行对比来进行筛选
列出当前目录中的非全球地图
grep -f gokz.txt maplist -v
列出当前目录中缺少的全球地图
grep -f maplist gokz.txt -v
删除所有官方地图
rm ar_* cs_* de_* dz_* gd_* lobby_* training*