温馨提示×

怎样导入linux postman

小樊
36
2026-09-12 13:27:38
栏目: 智能运维

在 Linux 上“导入 Postman”一般有两种理解,我分别说明,你可以看哪种符合你的需求。


一、在 Linux 上安装并导入 Postman 应用

1. 安装 Postman(Linux 桌面环境)

方式一:官方压缩包(推荐)

# 下载
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

# 解压
tar -xzf postman.tar.gz -C /opt

# 创建软链接
ln -s /opt/Postman/Postman /usr/local/bin/postman

启动:

postman

方式二:Snap(Ubuntu 等)

sudo snap install postman

2. 导入 Postman 数据(Collection / Environment)

Postman 中的数据通常是:

  • *.json(Collection 或 Environment 文件)

导入步骤:

  1. 打开 Postman
  2. 点击左上角 Import
  3. 选择:
    • 文件(File)
    • 文件夹(Folder)
    • 或粘贴 JSON / URL
  4. 选择你的 xxx.json
  5. 点击 Import

常见文件类型:

  • Collection:postman_collection.json
  • 环境变量:postman_environment.json

二、在 Linux 命令行中使用 Postman(Newman)

如果你说的是“在 Linux 服务器上跑 Postman 接口测试”:

1. 安装 Node.js

sudo apt install nodejs npm

2. 安装 Newman

sudo npm install -g newman

3. 导入并运行 Collection

newman run your_collection.json

带环境变量:

newman run your_collection.json -e your_environment.json

三、从 Windows / macOS 导出后导入 Linux

  1. 在原系统 Postman 中:
    • Settings → Data → Export Data
  2. 拷贝 *.json 到 Linux
  3. 在 Linux Postman 中 Import

如果你能具体说明:

  • 桌面 Postman 还是 命令行
  • 导入的是 Collection / Environment / 整个账号数据

我可以给你更精确的步骤。

0