Linux云主机/VPS/物理服务器使用的各种常用脚本/命令大全

Linux云主机/VPS/物理服务器使用的各种常用脚本/命令大全

一、DD网络重装脚本:

1、moeclub大佬的脚本:系统默认为debian12(把12换成11也可DD成11,把“密码”和“端口”分别替换成你自己想设置的)

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 12 -v 64 -p 密码 -port 端口 -a -firmware

2、leitbogioro大佬的脚本:

wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh && bash InstallNET.sh -debian 12 -pwd '密码'

3、beta.gs大佬的脚本:

wget --no-check-certificate -O NewReinstall.sh https://raw.githubusercontent.com/fcurrk/reinstall/master/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh

二、服务器综合测试脚本

1、很多功能集中一起的融合怪

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh

2、测试独立服务器硬件和硬盘时间,硬盘I/O情况,下载速度:

wget -q https://github.com/Aniverse/A/raw/i/a && bash a

三、性能测试脚本

1、YABS:

wget -qO- yabs.sh | bash

2、流量稀缺的服务器(不测试iperf网络)

curl -sL yabs.sh | bash -s -- -i

3、geekbench5(不测试geekbench6)

curl -sL yabs.sh | bash -s -- -5

4、Geekbench 5 专测脚本

bash <(curl -sL gb5.top)

5、LemonBench

wget -qO- https://raw.githubusercontent.com/LemonBench/LemonBench/main/LemonBench.sh | bash -s -- --fast

6、unixbench.sh

wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh

四、网络测试脚本

1、hyperspeed 三网测速(未开源,慎用)

bash <(curl -Lso- https://bench.im/hyperspeed)

2、AutoTrace 三网回程线路显示

wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh

3、backtrace 三网回程线路直接显示(小白用这个)

curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh

4、Bench 网络带宽及硬盘读写速率(国外部分+国内部分节点)

wget -qO- bench.sh | bash

5、SuperBench.sh 网络带宽及硬盘读写速率(国内三网+speedtest+fast)

wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

五、冷门功能的测试脚本

1、超售测试脚本

wget --no-check-certificate -O memoryCheck.sh https://raw.githubusercontent.com/uselibrary/memoryCheck/main/memoryCheck.sh && chmod +x memoryCheck.sh && bash memoryCheck.sh

2、移除virtio_balloon模块

rmmod virtio_balloon

3、内存填充测试

apt-get update
apt-get install wget build-essential -y
wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp
gcc -l stdc++ memtester.cpp
./a.out

六、流媒体测试脚本

1、RegionRestrictionCheck脚本

bash <(curl -L -s check.unlock.media)

2、openai解锁检测

bash <(curl -Ls https://github.com/ludashi2020/OpenAI-Checker/raw/main/openai.sh)

七、BBR等,服务器减少丢包/加速类脚本

1、一键开启BBR(适用于较新的Debian、Ubuntu)

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

2、Linux-NetSpeed(锐速/bbrplus/bbr魔改版)

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh"
chmod +x tcp.sh
./tcp.sh

3、ylx大佬的锐速/BBRPLUS/BBR2

wget -O tcpx.sh "https://github.com/ylx2016/Linux-NetSpeed/raw/master/tcpx.sh" && chmod +x tcpx.sh && ./tcpx.sh

八、常用软件脚本

1、Docker安装脚本

curl -sSL https://get.docker.com/ | sh

2、Aria2一键安装脚本

wget -N git.io/aria2.sh && chmod +x aria2.sh && bash aria2.sh

3、XUI一键脚本

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

4、qbittorrent 4.3.9安装教程

cd /root
wget https://github.com/userdocs/qbittorrent-nox-static/releases/download/release-4.3.9_v1.2.15/x86_64-qbittorrent-nox
chmod +x x86_64-qbittorrent-nox
./x86_64-qbittorrent-nox 

输入y 然后ctrl+c退出,接下来复制下面代码运行:

cat << "EOF" > /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
LimitNOFILE=512000
User=root
ExecStart=/root/x86_64-qbittorrent-nox

[Install]
WantedBy=multi-user.target
EOF
# 更新配置
systemctl daemon-reload
# 启动服务
systemctl start qbittorrent
# 查看状态
systemctl status qbittorrent

如需重启/关闭程序
请使用kill命令关闭程序
ps -aux | grep qbittorrent
kill 对应序号
如 kill 11111
再使用进程守护打开即可使用

5、宝塔一键挂载硬盘脚本

wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

6、acme生成免费证书

curl https://get.acme.sh | sh

7、闲着蛋疼刷流量脚本(没什么意义的东西,刷别人的主机流量)

wget https://cdn.jsdelivr.net/gh/maintell/webBenchmark@releases/download/0.6/webBenchmark_linux_x64
chmod +x webBenchmark_linux_x64
./webBenchmark_linux_x64 -c 64 -s http://链接.jpg

8、腾讯云删除监控

sudo -i
systemctl stop tat_agent
systemctl disable tat_agent
/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh
rm -f /etc/systemd/system/tat_agent.service
rm -rf /usr/local/qcloud
rm -rf /usr/local/sa
rm -rf /usr/local/agenttools
rm -rf /usr/local/qcloud
process=(sap100 secu-tcs-agent sgagent64 barad_agent agent agentPlugInD pvdriver )
for i in ${process[@]}
do
  for A in $(ps aux | grep $i | grep -v grep | awk '{print $2}')
  do
    kill -9 $A
  done
done

9、测试 25 端口是否开放(smpt.aol.com可换成其他你知道的邮局smtp地址)

telnet smtp.aol.com 25

10、测试 IPv4 优先还是 IPv6 优先

curl ip.p3terx.com

九、其他功能的脚本

1、moerats大佬的添加swap脚本

wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh

2、spiritlhl大佬的zram内存压缩脚本

curl -L https://raw.githubusercontent.com/spiritLHLS/addzram/main/addzram.sh -o addzram.sh && chmod +x addzram.sh && bash addzram.sh

3、cloudflare warp脚本 添加IPv4/IPv6网络(2023.12.10更新)

wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh [option] [lisence/url/token]

4、fail2ban(服务器ssh防爆破)

wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/fail2ban.sh && bash fail2ban.sh 2>&1 | tee fail2ban.log

5、流媒体解锁检测,多个合在一起了,选其中一个使用即可:

#融合测试
bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)

#tiktok检测
bash <(curl -s https://raw.githubusercontent.com/lmc999/TikTokCheck/main/tiktok.sh)

#第一个
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

# 第二个
bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")

# 第三个
bash <(curl -L -s check.unlock.media)

# 第四个
bash <(curl -Ls unlock.moe)

# 检测Netflix:

wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.6/nf_2.6_linux_amd64 && chmod +x nf && clear && ./nf -method full

# 一键检测youtube和奈飞:

wget -O tubecheck https://github.com/sjlleo/TubeCheck/releases/download/1.0Beta/tubecheck_1.0beta_linux_amd64 && chmod +x tubecheck && clear && ./tubecheck

# 抖音解锁脚本
bash <(curl -s https://raw.githubusercontent.com/lmc999/TikTokCheck/main/tiktok.sh)

一、文件和目录操作命令:

1. ls:列出当前目录下的文件和子目录。
2. cd:切换当前工作目录。
3. pwd:显示当前工作目录的路径。
4. cp:复制文件或目录。
5. mv:移动或重命名文件或目录。
6. rm:删除文件或目录。
7. mkdir:创建目录。
8. rmdir:删除空目录。

二、文件查看和编辑命令:

1. cat:查看文件内容。
2. less:分页显示文件内容。
3. head:显示文件的前几行。
4. tail:显示文件的最后几行。
5. touch:创建文件。
6. grep:在文件中搜索指定的模式。
7. vi/vim:文本编辑器。

三、文件权限和用户管理命令:

1. chmod:修改文件或目录的权限。
2. chown:修改文件或目录的所有者。
3. chgrp:修改文件或目录的所属组。
4. useradd:创建用户账号。
5. userdel:删除用户账号。
6. passwd:修改用户密码。

四、系统管理命令:

1. ps:查看当前运行的进程。
2. top:实时显示系统资源使用情况。
3. kill:结束指定的进程。
4. shutdown:关闭或重启系统。
5. reboot:重启系统。
6. df:显示文件系统的磁盘空间使用情况。
7. du:计算目录和文件的大小。
8. ifconfig:查看和设置网络接口的配置。
9. ping:测试网络连接。
10. netstat:显示网络连接、路由表和网络接口统计信息。

五、压缩和解压命令:

1. tar:打包和解包文件。
2. gzip:压缩文件。
3. gunzip:解压缩文件。
4. zip:压缩文件。
5. unzip:解压缩文件。

六、其他常用命令:

1. ssh:远程登录到另一台计算机。
2. scp:通过网络安全地复制文件。
3. find:在文件系统中搜索文件。
4. history:显示最近使用过的命令历史记录。
5. crontab:设置定时任务。
6. wget:下载文件。
7. curl:通过网络传输数据。

以上是一些常用的Linux命令,可以帮助你进行文件和目录的操作、文件查看和编辑、文件权限和用户管理、系统管理、压缩和解压以及其他一些常用任务。使用这些命令可以更高效地管理和操作Linux系统。

原创文章,作者:中国IPv6网,如若转载,请注明出处:https://www.ipv6s.com/basis/application/202404154107.html

(0)
中国IPv6网的头像中国IPv6网
上一篇 2024年4月14日 下午2:41
下一篇 1天前

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注