当前位置:首页>Linux>Linux 常用命令速查指南

Linux 常用命令速查指南

  • 2026-06-29 01:07:14
Linux 常用命令速查指南

Linux 常用命令速查指南

面向开发者的实用命令手册,覆盖文件操作、文本处理、网络调试、进程管理、Docker/K8s 等场景


一、文件与目录操作

查看与导航

# 查看当前目录
pwd

# 列出文件(详细信息)
ls -la

# 列出文件(按时间倒序,最新的在前)
ls -lt

# 列出文件(人类可读的文件大小)
ls -lh

# 只列出目录
ls -d */

# 切换目录
cd /path/to/dir
cd ..          # 上一级
cd ~           # 回到用户主目录
cd -           # 回到上一次的目录

# 查看目录树结构(需安装 tree)
tree -L 2      # 显示 2 层深度

创建与删除

# 创建目录(含父目录)
mkdir -p /path/to/new/dir

# 创建空文件
touch file.txt

# 删除文件
rm file.txt

# 删除目录(递归,强制,不提示)
rm -rf dir_name

# 复制文件
cp source.txt dest.txt

# 复制目录
cp -r source_dir/ dest_dir/

# 移动/重命名
mv old_name.txt new_name.txt
mv file.txt /other/path/

查看文件内容

# 查看完整文件
cat file.txt

# 查看前 N 行
head -n 20 file.txt

# 查看后 N 行
tail -n 20 file.txt

# 实时跟踪文件末尾(看日志用)
tail -f /var/log/app.log

# 实时跟踪 + 只看包含 ERROR 的行
tail -f /var/log/app.log | grep ERROR

# 分页查看大文件
less file.txt
# less 中:q 退出,/ 搜索,n 下一个匹配,G 跳到末尾

# 查看文件行数/字数/字节数
wc -l file.txt    # 行数
wc -w file.txt    # 字数

查找文件

# 按名称查找
find / -name "*.log"
find /app -name "settings.py"

# 按名称查找(不区分大小写)
find / -iname "readme*"

# 查找最近 1 天内修改的文件
find /app -mtime -1

# 查找大于 100M 的文件
find / -size +100M

# 快速定位命令路径
which python
which nginx

# 查找文件(基于索引,更快但可能不是最新)
locate settings.py

二、文本搜索与处理

grep 文本搜索

# 在文件中搜索关键词
grep "ERROR" app.log

# 递归搜索目录下所有文件
grep -r "database" /app/configs/

# 忽略大小写
grep -i "error" app.log

# 显示行号
grep -n "ERROR" app.log

# 显示匹配行的前后 3 行上下文
grep -C 3 "Exception" app.log

# 反向匹配(排除包含 DEBUG 的行)
grep -v "DEBUG" app.log

# 统计匹配行数
grep -c "ERROR" app.log

# 正则匹配
grep -E "error|warning|fatal" app.log

# 只输出匹配的文件名
grep -rl "password" /app/

sed 文本替换

# 替换文件中的文本(直接修改文件)
sed -i 's/old_text/new_text/g' file.txt

# 替换(不修改原文件,输出到新文件)
sed 's/old/new/g' file.txt > new_file.txt

# 删除空行
sed '/^$/d' file.txt

# 删除第 5 行
sed '5d' file.txt

# 只打印第 10-20 行
sed -n '10,20p' file.txt

awk 文本分析

# 打印第 1 列和第 3 列(默认空格分隔)
awk '{print $1, $3}' file.txt

# 指定分隔符(如冒号)
awk -F: '{print $1, $3}' /etc/passwd

# 打印行号和内容
awk '{print NR, $0}' file.txt

# 条件过滤(第 3 列大于 100)
awk '$3 > 100 {print $0}' data.txt

# 求和
awk '{sum += $1} END {print sum}' numbers.txt

排序与去重

# 排序
sort file.txt

# 数字排序
sort -n file.txt

# 倒序
sort -r file.txt

# 去重
sort file.txt | uniq

# 去重并统计出现次数(按次数倒序)
sort file.txt | uniq -c | sort -rn

三、权限与用户

# 查看文件权限
ls -la file.txt

# 修改权限(所有人可读可写可执行)
chmod 777 file.txt

# 常用权限
chmod 755 script.sh    # 所有者 rwx,其他人 rx
chmod 644 config.txt   # 所有者 rw,其他人 r
chmod +x script.sh     # 添加执行权限

# 修改文件所有者
chown user:group file.txt
chown -R user:group dir/   # 递归

# 查看当前用户
whoami

# 切换用户
su - username

# 以 root 权限执行
sudo command

四、网络与调试

网络连通性

# ping 测试
ping -c 4 10.19.103.159

# 测试端口是否通(替代 telnet)
nc -zv 10.19.103.159 9200

# 查看路由跳数
traceroute 10.19.103.159

# DNS 查询
nslookup example.com
dig example.com

# 查看本机 IP
ip addr
hostname -I

curl HTTP 请求

# GET 请求
curl http://example.com/api

# POST 请求(JSON)
curl -X POST "http://example.com/api" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

# 带认证
curl -u "user:password" http://example.com/api

# 显示响应头
curl -I http://example.com

# 详细调试信息
curl -v http://example.com

# 忽略 SSL 证书验证
curl -k https://example.com

# 下载文件
curl -O http://example.com/file.tar.gz

# 设置超时(秒)
curl --connect-timeout 5 --max-time 30 http://example.com

# 输出格式化 JSON
curl -s http://example.com/api | python3 -m json.tool
curl -s http://example.com/api | jq .

# 测试 SSL/TLS 握手
openssl s_client -connect example.com:443 -servername example.com

端口与连接

# 查看所有监听端口
ss -tlnp
netstat -tlnp

# 查看指定端口被谁占用
lsof -i :8080
ss -tlnp | grep 8080

# 查看所有网络连接
ss -anp

# 查看防火墙规则
iptables -L -n
firewall-cmd --list-all

五、进程管理

# 查看所有进程
ps aux

# 搜索指定进程
ps aux | grep python
ps aux | grep nginx

# 实时进程监控(类似任务管理器)
top
htop    # 更好用,需安装

# 杀死进程
kill PID
kill -9 PID    # 强制杀死

# 按名称杀死进程
pkill -f "python api.py"
killall python

# 后台运行命令
nohup python api.py > output.log 2>&1 &

# 查看后台任务
jobs

# 查看系统负载
uptime

六、磁盘与内存

# 查看磁盘使用情况
df -h

# 查看当前目录大小
du -sh .

# 查看子目录大小(排序)
du -sh */ | sort -rh

# 查看内存使用
free -h

# 查看系统信息
uname -a

# 查看 CPU 信息
lscpu
cat /proc/cpuinfo | head -20

七、压缩与解压

# tar.gz 压缩
tar -czf archive.tar.gz dir_name/

# tar.gz 解压
tar -xzf archive.tar.gz

# 解压到指定目录
tar -xzf archive.tar.gz -C /target/dir/

# zip 压缩
zip -r archive.zip dir_name/

# zip 解压
unzip archive.zip

# 查看压缩包内容(不解压)
tar -tzf archive.tar.gz
unzip -l archive.zip

八、系统服务管理(systemctl)

# 查看服务状态
systemctl status nginx

# 启动/停止/重启服务
systemctl start nginx
systemctl stop nginx
systemctl restart nginx

# 设置开机自启
systemctl enable nginx
systemctl disable nginx

# 查看所有运行中的服务
systemctl list-units --type=service --state=running

# 查看服务日志
journalctl -u nginx -f          # 实时跟踪
journalctl -u nginx --since today

九、Docker 常用命令

# 查看运行中的容器
docker ps

# 查看所有容器(含已停止)
docker ps -a

# 查看镜像列表
docker images

# 运行容器
docker run -d --name myapp -p 8080:8080 image_name

# 进入运行中的容器
docker exec -it container_name bash
docker exec -it container_name sh    # 如果没有 bash

# 查看容器日志
docker logs container_name
docker logs -f container_name          # 实时跟踪
docker logs --tail 100 container_name  # 最后 100 行

# 停止/启动/重启容器
docker stop container_name
docker start container_name
docker restart container_name

# 删除容器
docker rm container_name
docker rm -f container_name    # 强制删除运行中的

# 删除镜像
docker rmi image_name

# 构建镜像
docker build -t image_name:tag .

# 查看容器资源占用
docker stats

# 复制文件到容器/从容器复制
docker cp local_file container_name:/path/
docker cp container_name:/path/file local_file

# 清理无用资源
docker system prune -f

十、Kubernetes (kubectl) 常用命令

# 查看所有 Pod
kubectl get pods -A
kubectl get pods -n namespace_name

# 查看 Pod 详情
kubectl describe pod pod_name -n namespace

# 查看 Pod 日志
kubectl logs pod_name -n namespace
kubectl logs -f pod_name -n namespace          # 实时跟踪
kubectl logs pod_name -n namespace --tail=100  # 最后 100 行

# 进入 Pod
kubectl exec -it pod_name -n namespace -- bash
kubectl exec -it pod_name -n namespace -- sh

# 查看 Service
kubectl get svc -A

# 查看 Ingress
kubectl get ingress -A
kubectl describe ingress ingress_name -n namespace

# 查看 ConfigMap / Secret
kubectl get configmap -n namespace
kubectl get secret -n namespace
kubectl describe secret secret_name -n namespace

# 查看节点
kubectl get nodes
kubectl describe node node_name

# 查看集群事件
kubectl get events -n namespace --sort-by='.lastTimestamp'

# 端口转发(本地调试)
kubectl port-forward pod_name 8080:8080 -n namespace

# 扩缩容
kubectl scale deployment deploy_name --replicas=3 -n namespace

# 重启 Deployment(滚动重启)
kubectl rollout restart deployment deploy_name -n namespace

# 查看部署历史
kubectl rollout history deployment deploy_name -n namespace

# 查看资源使用
kubectl top pods -n namespace
kubectl top nodes

十一、Git 常用命令

# 查看状态
git status

# 查看分支
git branch -a

# 切换分支
git checkout branch_name
git switch branch_name

# 创建并切换新分支
git checkout -b new_branch

# 拉取最新代码
git pull
git pull origin main

# 暂存 + 提交
git add .
git commit -m "提交说明"

# 推送
git push origin branch_name

# 查看提交日志
git log --oneline -20

# 查看某个文件的修改历史
git log --oneline -p file.py

# 查看差异
git diff
git diff --staged

# 暂存当前修改(不提交)
git stash
git stash pop

# 回退到上一个提交(保留修改)
git reset --soft HEAD~1

# 回退到上一个提交(丢弃修改)
git reset --hard HEAD~1

# 合并分支
git merge branch_name

# 变基
git rebase main

十二、日志分析实战

# 统计 ERROR 出现次数
grep -c "ERROR" app.log

# 按小时统计错误数
grep "ERROR" app.log | awk '{print substr($1,1,13)}' | sort | uniq -c

# 查看最近 1 小时的日志
awk -v d="$(date -d '1 hour ago' '+%Y-%m-%d %H:%M')"'$0 >= d' app.log

# 提取所有 IP 并统计访问次数
awk '{print $1}' access.log | sort | uniq -c | sort -rn | head -20

# 查看响应时间最慢的 10 个请求
awk '{print $NF, $7}' access.log | sort -rn | head -10

# 实时监控错误日志并报警
tail -f app.log | grep --line-buffered "ERROR" | whileread line; do
echo"$(date) ALERT: $line"
done

十三、管道与重定向

# 管道:将前一个命令的输出作为后一个命令的输入
cat file.txt | grep "error" | wc -l

# 输出重定向(覆盖)
echo"hello" > file.txt

# 输出重定向(追加)
echo"world" >> file.txt

# 错误输出重定向
command 2> error.log

# 标准输出和错误输出都重定向
command > output.log 2>&1

# 丢弃所有输出
command > /dev/null 2>&1

# xargs:将输入转为命令参数
find . -name "*.pyc" | xargs rm -f
grep -rl "old_text" . | xargs sed -i 's/old_text/new_text/g'

十四、快捷键

快捷键
作用
Ctrl+C
终止当前命令
Ctrl+Z
挂起当前命令(bg 恢复后台运行)
Ctrl+D
退出当前 shell
Ctrl+L
清屏(等同 clear)
Ctrl+R
搜索历史命令
Ctrl+A
光标移到行首
Ctrl+E
光标移到行尾
Ctrl+W
删除光标前一个单词
Tab
自动补全命令/路径
!!
重复上一条命令
!$
上一条命令的最后一个参数

以上命令基于 CentOS/Ubuntu 等主流 Linux 发行版,部分命令可能需要 sudo 权限或额外安装(如 htopjqtree)。

十五、历史记录与清理

# 查看历史命令
history

# 查看最近 20 条
history 20

# 搜索历史命令(交互式)
Ctrl+R  # 然后输入关键词,按 Ctrl+R 继续搜索上一条

# 执行历史中第 N 条命令
!100

# 执行上一条命令
!!

# 执行上一条以 curl 开头的命令
!curl

# 清除当前会话的历史记录
history -c

# 清除历史记录文件(彻底清除)
history -c && history -w
# 或直接清空文件
> ~/.bash_history && history -c

# 删除历史中指定某一条(如第 150 条)
history -d 150

# 执行命令但不记录到历史(前面加空格)
 curl -u "user:pass" http://example.com   # 注意最前面有个空格

# 设置历史记录不保存(临时)
export HISTSIZE=0

# 清屏
clear
# 或
Ctrl+L

十六、环境变量与配置

# 查看所有环境变量
env
printenv

# 查看指定环境变量
echo$PATH
echo$HOME
echo$USER

# 临时设置环境变量(当前会话有效)
export MY_VAR="hello"
export PATH=$PATH:/new/path

# 永久设置(写入配置文件)
echo'export MY_VAR="hello"' >> ~/.bashrc
source ~/.bashrc    # 立即生效

# 取消环境变量
unset MY_VAR

# 常用配置文件
~/.bashrc       # 用户级 bash 配置(每次打开终端加载)
~/.bash_profile # 用户级登录配置(登录时加载)
/etc/profile    # 系统级配置
/etc/environment # 系统环境变量

# 查看当前 shell
echo$SHELL

# 切换 shell
chsh -s /bin/zsh

十七、定时任务(crontab)

# 查看当前用户的定时任务
crontab -l

# 编辑定时任务
crontab -e

# cron 表达式格式:分 时 日 月 周
# ┌───── 分钟 (0-59)
# │ ┌───── 小时 (0-23)
# │ │ ┌───── 日 (1-31)
# │ │ │ ┌───── 月 (1-12)
# │ │ │ │ ┌───── 星期 (0-7, 0和7都是周日)
# │ │ │ │ │
# * * * * * command

# 每分钟执行
* * * * * /path/to/script.sh

# 每天凌晨 2 点执行
0 2 * * * /path/to/backup.sh

# 每周一上午 9 点执行
0 9 * * 1 /path/to/report.sh

# 每 5 分钟执行
*/5 * * * * /path/to/check.sh

# 每天 8 点和 20 点执行
0 8,20 * * * /path/to/task.sh

# 查看 cron 执行日志
grep CRON /var/log/syslog
journalctl -u cron

十八、SSH 远程操作

# 登录远程服务器
ssh user@10.19.103.159
ssh -p 2222 user@host    # 指定端口

# 免密登录配置
ssh-keygen -t rsa                          # 生成密钥对
ssh-copy-id user@10.19.103.159             # 复制公钥到服务器

# 远程执行命令(不登录)
ssh user@host "ls -la /app"
ssh user@host "docker ps"

# 文件传输 scp
scp local_file user@host:/remote/path/           # 上传
scp user@host:/remote/file local_path/            # 下载
scp -r local_dir/ user@host:/remote/path/         # 上传目录

# rsync 同步(增量传输,更高效)
rsync -avz local_dir/ user@host:/remote/dir/
rsync -avz --delete local_dir/ user@host:/remote/dir/  # 同步删除

# SSH 隧道(端口转发)
# 本地转发:访问本地 9200 等于访问远程 ES
ssh -L 9200:10.19.103.159:9200 user@jump_host

# 后台保持 SSH 连接
ssh -fN -L 9200:10.19.103.159:9200 user@jump_host

# SSH 配置文件(免得每次输一长串)
# 编辑 ~/.ssh/config
Host prod-server
    HostName 10.19.103.159
    User deploy
    Port 22
    IdentityFile ~/.ssh/id_rsa
# 之后直接 ssh prod-server 即可

十九、系统监控与排障

# 查看系统运行时间和负载
uptime

# 查看谁在登录
w
who

# 查看系统日志
dmesg | tail -20                    # 内核日志
journalctl -xe                      # 系统日志(最近的错误)
cat /var/log/messages               # 系统消息
cat /var/log/secure                 # 登录日志

# 查看 OOM(内存不足被杀)记录
dmesg | grep -i "oom\|killed"
journalctl -k | grep -i "oom"

# 查看 TCP 连接状态统计
ss -s
ss -ant | awk '{print $1}' | sort | uniq -c | sort -rn

# 查看 IO 使用情况
iostat -x 1 5     # 每秒刷新,共 5 次
iotop              # 实时 IO 监控(需安装)

# 查看网络流量
iftop              # 实时网络流量(需安装)
nethogs            # 按进程查看网络流量(需安装)

# 查看文件被哪个进程占用
lsof /path/to/file
fuser -v /path/to/file

# 查看删除但未释放的文件(磁盘满排查)
lsof | grep deleted | sort -k7 -rn | head -20

二十、实用技巧与组合命令

# 命令替换:用上一条命令的结果
echo"当前目录: $(pwd)"
echo"Python 版本: $(python3 --version)"

# 多条命令顺序执行
command1 && command2    # 前一个成功才执行后一个
command1 || command2    # 前一个失败才执行后一个
command1 ; command2     # 无论成功失败都执行

# 后台执行 + 日志
nohup python3 app.py > app.log 2>&1 &
echo $!    # 打印后台进程 PID

# 批量重命名
# 把所有 .txt 改成 .md
for f in *.txt; do mv "$f""${f%.txt}.md"done

# 批量查找替换文件内容
find . -name "*.py" -exec sed -i 's/old_text/new_text/g' {} +

# 监控命令输出变化(每 2 秒刷新)
watch -n 2 "docker ps"
watch -n 5 "kubectl get pods -n prod"

# 计算命令执行时间
time curl -s http://example.com > /dev/null

# 生成随机密码
openssl rand -base64 16
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 20

# 快速创建大文件(测试用)
dd if=/dev/zero of=test_100m.bin bs=1M count=100
fallocate -l 1G test_1g.bin

# 对比两个文件差异
diff file1.txt file2.txt
diff -u file1.txt file2.txt    # unified 格式,更易读

# 查看命令帮助
man command_name
command_name --help
tldr command_name    # 更简洁的帮助(需安装 tldr)

全文共 20 个章节,覆盖日常开发、运维、排障的绝大多数场景。建议收藏后按需查阅。

二十一、Shell 脚本执行

运行 .sh 脚本的几种方式

# 方式一:bash 直接执行(不需要执行权限)
bash run.sh
bash /app/sh/start_report.sh

# 方式二:sh 执行
sh run.sh

# 方式三:先加执行权限,再直接运行
chmod +x run.sh
./run.sh

# 方式四:source 执行(在当前 shell 环境中运行,环境变量会保留)
source run.sh
. run.sh    # 等同于 source

# 方式五:后台运行(终端关闭后不中断)
nohup bash run.sh > run.log 2>&1 &

# 方式六:后台运行 + 查看日志
nohup bash run.sh > run.log 2>&1 &
tail -f run.log

区别说明

方式
是否需要 +x 权限
是否在子 shell
终端关闭后
bash run.sh
不需要
子 shell
中断
./run.sh
需要 chmod +x
子 shell
中断
source run.sh
不需要
当前 shell
中断
nohup bash run.sh &
不需要
子 shell
不中断

常见启动场景

# 启动 Python 服务
nohup python3 api.py > logs/api.log 2>&1 &

# 启动 Flask/FastAPI 服务
nohup python3 -u api/jindie_merge_api.py > logs/jindie.log 2>&1 &
# -u 参数:不缓冲输出,日志实时写入

# 启动多个服务
bash sh/start_report.sh &
bash sh/start_financial_report.sh &

# 指定端口启动
nohup python3 -u api/report_api.py --port 8991 > logs/report.log 2>&1 &

# 带环境变量启动
AIBI_ENV=PROD nohup python3 api/jindie_merge_api.py > logs/prod.log 2>&1 &
AIBI_ENV=TEST bash run.sh

# 查看启动的后台进程
jobs -l
ps aux | grep python

# 停止后台服务
kill $(ps aux | grep 'jindie_merge_api' | grep -v grep | awk '{print $2}')
# 或者用 pkill
pkill -f "jindie_merge_api"

脚本调试

# 调试模式运行(打印每一行执行的命令)
bash -x run.sh

# 遇到错误立即退出
bash -e run.sh

# 脚本内部开启调试(在 .sh 文件头部加)
#!/bin/bash
set -ex    # -e 遇错退出,-x 打印执行过程

# 检查脚本语法(不执行)
bash -n run.sh

# 查看脚本内容
cat run.sh

开机自启动

# 方式一:写入 /etc/rc.local
echo"bash /app/run.sh" >> /etc/rc.local
chmod +x /etc/rc.local

# 方式二:创建 systemd 服务(推荐)
cat > /etc/systemd/system/myapp.service << 'EOF'
[Unit]
Description=My App Service
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/app
ExecStart=/usr/bin/python3 api/jindie_merge_api.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable myapp     # 开机自启
systemctl start myapp      # 立即启动
systemctl status myapp     # 查看状态

全文共 21 个章节。

二十二、查看服务与进程状态(全场景)

场景判断

# 先确认你的环境有没有 systemctl
which systemctl
# 如果输出路径 → 用 systemctl(完整 Linux 系统)
# 如果 not found → 你在 Docker 容器或精简系统里,用 ps 方式

方式一:systemctl(完整 Linux 系统,如 CentOS 7+、Ubuntu 16+)

# 查看所有运行中的服务
systemctl list-units --type=service --state=running

# 查看指定服务状态
systemctl status nginx
systemctl status docker

# 查看是否开机自启
systemctl is-enabled nginx

systemctl: not found 的原因:

  • Docker 容器内默认没有 systemd(容器只跑一个主进程,不需要服务管理器)
  • Alpine Linux 用的是 OpenRC 而不是 systemd
  • 老系统(CentOS 6)用的是 SysVinit(service 命令)

方式二:ps 查看进程(万能方式,任何环境都能用)

# 查看所有进程
ps aux

# 查看 Python 相关进程
ps aux | grep python

# 查看 Java 相关进程
ps aux | grep java

# 查看 nginx 进程
ps aux | grep nginx

# 更精确(排除 grep 自身)
ps aux | grep '[p]ython'

# 只看进程号和命令
ps -eo pid,cmd | grep python

# 查看进程树(父子关系)
ps auxf
pstree -p

方式三:service 命令(老系统 CentOS 6 / SysVinit)

# 查看所有服务状态
service --status-all

# 查看指定服务
service nginx status
service mysqld status

# 启动/停止
service nginx start
service nginx stop

方式四:Docker 容器内查看

# 容器内查看当前运行的进程
ps aux
# 如果 ps 也没有(极简镜像)
ls /proc/*/cmdline 2>/dev/null | whileread f; do
echo"PID $(echo $f | cut -d/ -f3)$(tr '\0' ' ' < $f)"
done

# 从宿主机查看容器内进程
docker top container_name

# 查看容器状态
docker ps
docker inspect container_name | grep -i status

# 查看容器资源占用
docker stats container_name

方式五:查看端口判断服务是否在运行

# 查看谁在监听端口(推荐 ss)
ss -tlnp

# 查看指定端口
ss -tlnp | grep 8080

# 如果没有 ss,用 netstat
netstat -tlnp

# 如果都没有,用 /proc
cat /proc/net/tcp    # 端口是十六进制

# 测试端口是否通
curl -s http://localhost:8080/health
# 或
echo > /dev/tcp/localhost/8080 && echo"端口通" || echo"端口不通"

快速判断表

环境
推荐命令
说明
CentOS 7+ / Ubuntu 16+
systemctl list-units --type=service
完整系统,有 systemd
CentOS 6
service --status-all
老系统,SysVinit
Docker 容器内
ps aux
容器无 systemd
Alpine 容器
ps aux
 或 rc-status
Alpine 用 OpenRC
任何环境
ps aux | grep xxx
万能方式
只关心端口
ss -tlnp
 或 netstat -tlnp
看端口判断服务

全文共 22 个章节。

二十三、查看系统信息与运行环境

判断操作系统类型和版本

# 查看系统发行版信息(最常用)
cat /etc/os-release

# 简洁输出
cat /etc/os-release | grep PRETTY_NAME
# 输出示例:PRETTY_NAME="Ubuntu 22.04.3 LTS"
# 输出示例:PRETTY_NAME="CentOS Linux 7 (Core)"
# 输出示例:PRETTY_NAME="Alpine Linux v3.18"
# 输出示例:PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"

# 其他方式(不同系统可能只有其中一个)
cat /etc/redhat-release     # CentOS / RHEL
cat /etc/debian_version     # Debian / Ubuntu
cat /etc/alpine-release     # Alpine

# 查看内核版本
uname -a
uname -r    # 只看内核版本号

# 查看系统架构(x86_64 / aarch64)
uname -m
arch

判断是否在 Docker 容器内

# 方法一:查看 cgroup(最可靠)
cat /proc/1/cgroup
# 如果输出包含 docker 或 kubepods → 在容器内
# 如果输出是 / → 在宿主机

# 方法二:查看 .dockerenv 文件
ls /.dockerenv 2>/dev/null && echo"在容器内" || echo"在宿主机"

# 方法三:查看 hostname
hostname
# 容器内通常是一串随机字符如 a3f8b2c1d4e5

# 方法四:查看 PID 1 的进程
ps -p 1 -o comm=
# 容器内通常是 python/java/nginx 等应用进程
# 宿主机通常是 systemd 或 init

判断是否在 K8s Pod 内

# 查看 K8s 注入的环境变量
env | grep KUBERNETES
# 如果有 KUBERNETES_SERVICE_HOST → 在 K8s Pod 内

# 查看 ServiceAccount
ls /var/run/secrets/kubernetes.io/ 2>/dev/null && echo"在 K8s Pod 内"

# 查看 Pod 名称
echo$HOSTNAME
cat /etc/hostname

查看已安装的软件和服务

# 查看包管理器类型(判断系统家族)
which apt && echo"Debian/Ubuntu 系"# apt
which yum && echo"CentOS/RHEL 系"# yum
which dnf && echo"Fedora/CentOS 8+ 系"# dnf
which apk && echo"Alpine 系"# apk
which pip && echo"Python 已安装"
which node && echo"Node.js 已安装"
which java && echo"Java 已安装"

# 查看已安装的包
dpkg -l                  # Debian/Ubuntu
rpm -qa                  # CentOS/RHEL
apk list --installed     # Alpine

# 搜索是否安装了某个包
dpkg -l | grep nginx     # Debian/Ubuntu
rpm -qa | grep nginx     # CentOS/RHEL
apk list | grep nginx    # Alpine

# 查看 Python 版本和已安装的包
python3 --version
pip list
pip freeze

# 查看 Java 版本
java -version

# 查看 Node 版本
node -v
npm -v

查看硬件和资源信息

# CPU 信息
lscpu
cat /proc/cpuinfo | grep "model name" | head -1
nproc    # CPU 核心数

# 内存信息
free -h
cat /proc/meminfo | head -5

# 磁盘信息
df -h
lsblk

# 系统运行时间和负载
uptime
# 输出示例:10:30:25 up 45 days, load average: 0.15, 0.10, 0.08
# load average 三个数字分别是 1分钟/5分钟/15分钟 平均负载
# 一般不超过 CPU 核心数就正常

快速环境摸底(一条命令搞定)

# 复制这段到任何 Linux 机器上执行,快速了解环境
echo"=== 系统 ===" && cat /etc/os-release 2>/dev/null | grep PRETTY || uname -a && \
echo"=== 内核 ===" && uname -r && \
echo"=== 架构 ===" && uname -m && \
echo"=== CPU ===" && nproc && \
echo"=== 内存 ===" && free -h | head -2 && \
echo"=== 磁盘 ===" && df -h / && \
echo"=== 容器? ===" && (ls /.dockerenv 2>/dev/null && echo"是" || echo"否") && \
echo"=== K8s? ===" && (env | grep -q KUBERNETES && echo"是" || echo"否") && \
echo"=== Python ===" && (python3 --version 2>/dev/null || echo"未安装") && \
echo"=== PID 1 ===" && ps -p 1 -o comm= 2>/dev/null

全文共 23 个章节。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 17:52:50 HTTP/2.0 GET : https://f.mffb.com.cn/a/487362.html
  2. 运行时间 : 0.269663s [ 吞吐率:3.71req/s ] 内存消耗:5,281.38kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=b5011caae79a8e58bdef0d84ad52d506
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000946s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001630s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.019670s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002494s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001493s ]
  6. SELECT * FROM `set` [ RunTime:0.001790s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001739s ]
  8. SELECT * FROM `article` WHERE `id` = 487362 LIMIT 1 [ RunTime:0.041580s ]
  9. UPDATE `article` SET `lasttime` = 1783072370 WHERE `id` = 487362 [ RunTime:0.026915s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.003703s ]
  11. SELECT * FROM `article` WHERE `id` < 487362 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001247s ]
  12. SELECT * FROM `article` WHERE `id` > 487362 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001046s ]
  13. SELECT * FROM `article` WHERE `id` < 487362 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.011673s ]
  14. SELECT * FROM `article` WHERE `id` < 487362 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.007558s ]
  15. SELECT * FROM `article` WHERE `id` < 487362 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.028854s ]
0.273190s